|
[ tidy-Patches-1166491 ] Bugfix for printing script/style: msg#00011web.html-tidy.tracker
Patches item #1166491, was opened at 2005-03-19 13:18 Message generated for change (Comment added) made by arnaud02 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390965&aid=1166491&group_id=27659 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Pending >Resolution: Fixed Priority: 5 Private: No Submitted By: Detlev Vendt (detlevv) Assigned to: Nobody/Anonymous (nobody) Summary: Bugfix for printing script/style Initial Comment: The patch is based on latest source (as of March 17th, 2005) and solves two problems: - behaviour regarding <table>/<form> re-arrangement, in certain situations Tidy tends to move tags in errneous way. - behaviour regarding the printing the contens of <style>/<script> tags, the content got mangled. I carry this with me since 2003. The changes are working well with a lot of wild-life page. detlevv ---------------------------------------------------------------------- >Comment By: Arnaud Desitter (arnaud02) Date: 2008-01-27 10:36 Message: Logged In: YES user_id=566665 Originator: NO See http://tidy.sf.net/issue/1877642 ---------------------------------------------------------------------- Comment By: Detlev Vendt (detlevv) Date: 2005-03-21 19:31 Message: Logged In: YES user_id=725273 I know this validation problem, but this isn't the case here. The problem is, as Bj�rn H�hrmann said, that tidyNodeGetText() uses the wrong mode - pls. refer to my patch. detlevv ---------------------------------------------------------------------- Comment By: Björn Höhrmann (hoehrmann) Date: 2005-03-21 19:28 Message: Logged In: YES user_id=188003 Note (again) that in HTML <script><!----></script> There is no comment at all, see http://esw.w3.org/topic/ValidationProblems ---------------------------------------------------------------------- Comment By: Detlev Vendt (detlevv) Date: 2005-03-21 19:24 Message: Logged In: YES user_id=725273 errata: there _is_ a parameter 'hide-comments', but within style/script (as said) nothing should be changed (neither deleted nor changed). ---------------------------------------------------------------------- Comment By: Detlev Vendt (detlevv) Date: 2005-03-21 19:21 Message: Logged In: YES user_id=725273 We should not do it more complicated than it is... Some facts: - tidy should never ever change the content of a <script> or <style> block (internally, this is content handled as CDATA) - tidy changes every '<' and '>' into '<' and '>' respectively within a script or style block without my patch. This has nothing to do with XHTML (example was taken from a simple HTML page w/o doctype). Also there is no --hide- comments parameter (see my option settings, all included...). At least within a script block comments as shown are valid and commonly used. detlevv ---------------------------------------------------------------------- Comment By: Björn Höhrmann (hoehrmann) Date: 2005-03-21 19:20 Message: Logged In: YES user_id=188003 tidyNodeGetText(...) uses mode = NORMAL when calling PPrintTree which is not the correct mode for various elements (or nodes in fact), it would need to use mode = CDATA for CDATA elements like script and style, etc. You can't reproduce this using the command line tool as it does not use tidyNodeGetText(...). I am not sure how to fix this though, maybe we should add a new function that allows setting the intial mode and make tidyNodeGetText a wrapper for that function. ---------------------------------------------------------------------- Comment By: Arnaud Desitter (arnaud02) Date: 2005-03-21 17:54 Message: Logged In: YES user_id=566665 Sorry to be dense. Considering: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <style type="text/css"><!-- testing... --> a { text-decoration:none; } <!-- another comment --> --></style> </head> <body> </body> </html> what is the problem ? Can somebody explain what is the expected bahaviour and what is the minimal set of tidy options necessary to reproduce this problem. Does it have to do with the content model of script/style in XHTML ? Does it have to do with "--hide-comments yes". Any clear explanation ? ---------------------------------------------------------------------- Comment By: Björn Höhrmann (hoehrmann) Date: 2005-03-21 16:44 Message: Logged In: YES user_id=188003 Well, the two code fragments are only ever equivalent if the input fragment is HTML and the resulting fragment is XHTML, otherwise the script element has different content. And Tidy does not implement this distinction, for a XHTML input document with <style type="text/css"><!--...--></style> Tidy would consider the style element to contain the text "<!--...-->" rather than a comment with the text "...". This is essentially necessary to support incorrectly coded XHTML. So if Tidy behaves as described, this is probably a bug (probably as this depends on the documentation for tidyNodeGetText(...) which I did not check). ---------------------------------------------------------------------- Comment By: Arnaud Desitter (arnaud02) Date: 2005-03-21 13:28 Message: Logged In: YES user_id=566665 Could you explain why the current behaviour is not correct ? Any reference to HTML standard ? ---------------------------------------------------------------------- Comment By: Detlev Vendt (detlevv) Date: 2005-03-20 15:15 Message: Logged In: YES user_id=725273 I did not succeed in reproducing the behaviour regarding the first problem, it seems to me, that meanwhile the problem is solved by another change. I've attached a changed patch, containing the solution for the mangled comments within style/script only. detlevv ---------------------------------------------------------------------- Comment By: Detlev Vendt (detlevv) Date: 2005-03-20 11:02 Message: Logged In: YES user_id=725273 Here's the sample code for the second case, comments are converted to < / > within style-tag using tidyNodeGetText: Origin: <style type="text/css"><!-- testing... --> a { text-decoration:none; } <!-- another comment --> --></style> Output of tidyNodeGetText(): <style type="text/css"><!-- testing... --> a { text-decoration:none; } <!-- another comment --> --></style> Options set: tidyOptSetInt (tdoc, TidyIndentSpaces, 0); tidyOptSetInt (tdoc, TidyWrapLen, 9999); tidyOptSetBool (tdoc, TidyHideComments, yes); tidyOptSetBool (tdoc, TidyForceOutput, yes); tidyOptSetBool (tdoc, TidyQuoteAmpersand, no); tidyOptSetBool (tdoc, TidyMark, no); tidyOptSetBool (tdoc, TidyNumEntities, no); ---------------------------------------------------------------------- Comment By: Björn Höhrmann (hoehrmann) Date: 2005-03-19 18:02 Message: Logged In: YES user_id=188003 Could you also attach test cases that demonstrate the undesired behavior and how current tidy and your patch would handle these cases? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390965&aid=1166491&group_id=27659 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________ Tidy-tracker mailing list Tidy-tracker@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/tidy-tracker |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ tidy-Bugs-1636028 ] Tidy API function tidyNodeGetText escapes output: 00011, SourceForge.net |
|---|---|
| Next by Date: | [ tidy-Bugs-1636028 ] Tidy API function tidyNodeGetText escapes output: 00011, SourceForge.net |
| Previous by Thread: | [ tidy-Bugs-1636028 ] Tidy API function tidyNodeGetText escapes outputi: 00011, SourceForge.net |
| Next by Thread: | [ tidy-Bugs-1823534 ] HTML TIDY will not fix my page: 00011, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |