[closure-devel] How to disable <span class="illegalstyle"> from being generated?

David Lichteblau david at lichteblau.com
Fri Mar 4 21:11:23 UTC 2011


Hi,

Quoting Andrei Stebakov (lispercat at gmail.com):
> I agree that style of the html code I sometimes get leaves much to be desired.
> In this case there is a <style> tag located inside <td> element. So
> chtml:parse injects the illegalstyle span in the code.
[...]
> How do I disable this from being generated?

I'm afraid the answer is "change chtml".

The Closure HTML project is, at the moment, mainly a reusable form of
Closure (the web browser)'s parser.

"Reusable" because it's a self-contained library, but indeed sometimes a
little limited in its reusability because there are assumptions about
how to repair non-DTD-conforming markup -- assumptions that either go
too far or do the wrong thing entirely.

Personally I'd like to see two different modes:

  1. repair HTML exactly like mainstream browsers do

     (I think this is equivalent to implementing "HTML5" instead of
     trying to follow the HTML4 transitional DTD.)

  2. ignore schema compliance issues entirely

     (plain tag soup parsing)

In that respect I'd "take patches", but I'm currently not working on
those patches myself.

d.




More information about the closure-devel mailing list