Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy 5.6.0 mangled html / php code. #872

Closed
somebadhat opened this issue Mar 14, 2020 · 2 comments
Closed

Tidy 5.6.0 mangled html / php code. #872

somebadhat opened this issue Mar 14, 2020 · 2 comments

Comments

@somebadhat
Copy link

somebadhat commented Mar 14, 2020

WINDOWS 10 64-BIT.

HTML Tidy for Windows version 5.6.0 TURNED:

<img src="start-menu<?php echo date("mdy")?>.jpg" width="1248" height="1663" border="0" alt="StartMenuSCREENSHOT WILL BE HERE TOMORROW">

INTO:

<img src="start-menu%3C?php%20echo%20date(">.jpg" width="1248" height="1663" border="0" alt="StartMenuSCREENSHOT WILL BE HERE TOMORROW"&gt;

USING THIS COMMAND:

tidy "21.php"> 22.php

I do not understand your documentation:

you are advised to make the start tag explicit and to use PHP, ASP, or JSTE code for just the attributes

Should I alter the command, alter the code, or not use tidy?

Somebadhat

@michaelsmoody
Copy link

I'm curious, if you slightly change this to:

<img src="<?php echo 'start-menu' + date('mdy') + '.jpg' ?>" width="1248" height="1663" border="0" alt="StartMenuSCREENSHOT WILL BE HERE TOMORROW">

Does it work more cleanly for you?

@geoffmcl
Copy link
Contributor

@somebadhat, well even my browser trips on your src URI/HREF...

The href src="blah..." can not contain date(""), ie inverted comma repeated in quoted string...

So the second suggested by @michaelsmoody does ok, because he changed that to date('mdy')...

But in either case Tidy treats the src="xxx" as a URI, and does its best to convert it, and does badly, in the double double quotes case...

If this is a *.php source, then it should first run through the servers php, to get the text, of the URI... removing <!php ... ?> element...

HTML Tidy is NOT the tool to run on php source. Maybe you have already worked this out, since there has been no further feedback, replies...

So closing this, since there appears to be no Tidy problem exposed... maybe I am wrong...

Feel free to te-open, with some new information, or open a new issue... thank...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants