Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to preserve conditional comments in <html> element in a Diazo theme?

Tags:

plone

diazo

I have a Diazo theme file which is based on the html5boilerplate. The theme uses conditional comments on the <html> element to identify particular versions of Internet Explorer, e.g.

<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

However, when the theme is applied Diazo seems to strip away these conditional comments and only the last

<!--<![endif]-->

is left in the final markup producing something like

<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="en" xml:lang="en"><!--<![endif]-->

with an unmatched endif. Using conditional comments within the <html> tag (e.g. inside <head> or further down in the document) seems to work fine.

Examples of a theme and rules files which have this issue are available at

https://github.com/hexagonit/hexagonit.themeskel/blob/master/hexagonit/themeskel/templates/less_theme/+namespace_package+/+package+/theme_resources

I'm using plone.app.theming 1.0b8 with the associated KGS versions from good-py.

like image 278
Kai Lautaportti Avatar asked Nov 04 '22 13:11

Kai Lautaportti


1 Answers

This looks like a bug in Diazo, please add it to the Plone bug tracker with component 'Diazo'.

like image 68
Laurence Rowe Avatar answered Nov 09 '22 23:11

Laurence Rowe