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

Leonardo Uribe commented on MYFACES-3854:
-----------------------------------------

After doing some experiments, it seems the easiest way to fix it includes two 
solutions:

- Detect when \r\n is used on the left side of a text and append it correctly. 
I have found that the code add just one caracter, usually  \r on the left, that 
is interpreted as an space but not as a carriage return.
- If an xml instruction is being processed, do not compress spaces on the next 
instruction.

This will solve the problem without introduce a complex logic to handle CDATA 
sections. The problem is in this step of the algorithm the structure of the xml 
has been lost, because text is grouped as chunks.

> oam-compress-spaces remove carriage return / line feed in CDATA sections
> ------------------------------------------------------------------------
>
>                 Key: MYFACES-3854
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3854
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.1.14
>         Environment: Linux, tomcat 7
>            Reporter: James G
>             Fix For: 2.1.15, 2.2.1
>
>
> When the "oam-compress-spaces" option removes spaces in a CDATA section it 
> can cause problems with the generated code.  For example, I sometimes do:
> <script type="text/javascript">
> //<![CDATA[
> someJavascript();
> //]]>
> </script>
> If there happens to be a space after //<![CDATA[, then it comes out:
> <script type="text/javascript">
> //<![CDATA[ someJavascript();
> //]]></script>
> so someJavascript() is not called by the browser.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to