Forum Feature requests

style element and comments

Ingo Chao
According to XHTML, I should mark

<style type="text/css"><!--/*--><![CDATA[/*><!--*/
...
/*]]>*/--></style>

http://www.hixie.ch/advocacy/xhtml

instead of <style type="text/css"><!-- ... --></style>

otherwise the comment is respected and the rules are dropped. Ok.

But it is not comfortable to manually insert these cryptic things.
What about enabling an Option like --ignore-style-comments or --allow-style-cdata ?

And I missed this info in the User Guidelines 4.0.
mikeday
Hi Ingo,

Prince is an XML processor without any of the HTML-specific parsing hacks that web browsers use, so it always treats <!-- ... --> comments as real comments that will be ignored, wherever they occur.

However, I must ask, why do you wish to comment out the contents of the <style> element at all? I was of the understanding that this trick was only necessary to hide CSS rules from older browsers, like the pre-4.0 browsers back in the '90s that would otherwise display the rules as text on the page. Is it really still necessary to do this today?
Anonymous
Thanks.
It's a bad habit from me and my old editor tool, and I'll change it. It's still recommended in Meyer's Definitive Guide though, and I saw it here and there visiting pages to debug in [css-d] too (but not that often). I thought it's worth a small mention in your UserGuide.
mikeday
You're right; we are currently updating the Prince User Guide for the 5.0 release, I'll make sure that we add a note about the way Prince handles comments in the style element.

Cheers,

Michael