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

ASF GitHub Bot commented on WICKET-6546:
----------------------------------------

GitHub user solomax opened a pull request:

    https://github.com/apache/wicket/pull/274

    [WICKET-6546] HTML comments are removed from inline CSS

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/wicket WICKET-6546-no-css-comments

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/wicket/pull/274.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #274
    
----
commit 976f28de7a890a5827ef8c160e74a40df2c87709
Author: Maxim Solodovnik <solomax666@...>
Date:   2018-04-03T14:23:48Z

    [WICKET-6546] HTML comments are removed from inline CSS

----


> CssContentHeaderItem comments CSS code with HTML comments
> ---------------------------------------------------------
>
>                 Key: WICKET-6546
>                 URL: https://issues.apache.org/jira/browse/WICKET-6546
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.24.0, 6.29.0
>            Reporter: Robert Niestroj
>            Assignee: Maxim Solodovnik
>            Priority: Minor
>         Attachments: wicket6546 (2).zip
>
>
> CssContentHeaderItem wraps the passed CSS in HTML comments thus rendering 
> invalid markup.
> Example code:
>  
> {code:java}
> @Override
> public void renderHead(Component component, IHeaderResponse response) {
>    super.renderHead(component, response);
>    response.render(CssContentHeaderItem.forCSS(".select2-container--open 
> {z-index: 100000;}", "select2-mod", ""));
> }
> {code}
> Renders:
>  
> {code:java}
> <style type="text/css" id="select2-mod">
> <!-- .select2-container--open {z-index: 100000;}-->
> </style>{code}
> The HTML comments in the CSS make the response invalid and in the browser you 
> get a XML Parsing Error - Not Well Formed.
>  
> It should not render this invalid html comments in CSS.
> Looking at the source code i think the error is in the CssUtils class: 
> https://github.com/apache/wicket/blob/wicket-6.x/wicket-core/src/main/java/org/apache/wicket/core/util/string/CssUtils.java
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to