[ 
https://issues.apache.org/jira/browse/WICKET-3801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050321#comment-13050321
 ] 

Juergen Donnerstag commented on WICKET-3801:
--------------------------------------------

The conditional comment problem is difficult to fix properly:
- what if you are using multiple different "groups" of conditional comments?
- we need to check that the "remaining open tag" with the comment are the same 
across all comments of the same group
- if the close tag (like in the workaround below) is also part of a conditional 
comment, than it should still work
- what if you have wicket components (normal or automatic ones) within the 
conditional comment? All Wicket components as of today require an open and 
close tag (or open-close). But in this case the close tag must be shared. Which 
component will be responsible to provide the tag body => Only components which 
merely change the tag attributes must be allowed
- there is probably more. 

What sounds easy can be very tricky sometimes. Unfortunately it takes some time 
to get it right. Pedro already provided a patch as a good starting point.

A workaround that should always work: Put the closing tags into conditional 
comments as well
<!--[if lt IE 7 ]> </html> <![endif]--> 
<!--[if IE 7 ]> </html> <![endif]--> 
<!--[if IE 8 ]> </html> <![endif]--> 
<!--[if (gte IE 9)|!(IE)]><!-->  </html> <!--<![endif]--> 



> Wicket fails parsing conditional comments surrounding the <html> tag
> --------------------------------------------------------------------
>
>                 Key: WICKET-3801
>                 URL: https://issues.apache.org/jira/browse/WICKET-3801
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC4
>         Environment: Win32, JDK 1.6.0_24
>            Reporter: Christian Lerch
>            Assignee: Juergen Donnerstag
>
> When you use conditional comments on the <html> tag, like:
> <!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
> <!--[if IE 7 ]>    <html class="no-js ie7" lang="en"> <![endif]-->
> <!--[if IE 8 ]>    <html class="no-js ie8" lang="en"> <![endif]-->
> <!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> 
> <!--<![endif]-->
> which is valid (x)html code, you'll get: 
> Unexpected RuntimeException
> Last cause: Tag does not have a close tag

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to