From: SourceForge.net <no...@so...> - 2012-06-08 09:37:23
|
Bugs item #3532726, was opened at 2012-06-07 03:44 Message generated for change (Comment added) made by kriegaex You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3532726&group_id=13153 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: Open Resolution: None Priority: 5 Private: No Submitted By: Alexander Kriegisch (kriegaex) Assigned to: Nobody/Anonymous (nobody) Summary: Non-breaking space in HEAD rejected Initial Comment: In some web pages I see buggy HTML code like this: <script type="text/javascript" src="common/js/prototype.js"></script> <script src="common/js/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="common/js/lightbox.js"></script><link rel="prev" href="apps_06_004.html"> The result is a warning (plain text not allowed in HEAD elements) plus the SCRIPT tags are ignored, i.e. removed from the output. This makes the filteres page unusable because I need those scripts. How to fix: Make JTidy more tolerant by just ignoring nob-breaking space in HEAD sections or treating it like regular whitespace, parsing the rest of the line correctly. ---------------------------------------------------------------------- >Comment By: Alexander Kriegisch (kriegaex) Date: 2012-06-08 02:37 Message: The attached patch fixes the problem for me. Instead of stopping to parse the HEAD section whenever a text node is found, now text tokens are just ignored and the parsing continues. This has the additional advantage that not only legal HTML after the problematic text node is parsed correctly but that for multiple occurrences of illegal text nodes withing HEAD a warning is printed for each location which helps debug bogus HEAD sections. Maybe there is a better and cleaner way to do this, but as I said, it works for me. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3532726&group_id=13153 |