[ 
https://issues.apache.org/jira/browse/DOXIASITETOOLS-160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated DOXIASITETOOLS-160:
------------------------------------------
    Summary: Normalize line endings in skin template content on SiteRenderer 
side rather that Velocity side  (was: Normalize line ending in skin template 
content on SiteRenderer side rather that Velocity side)

> Normalize line endings in skin template content on SiteRenderer side rather 
> that Velocity side
> ----------------------------------------------------------------------------------------------
>
>                 Key: DOXIASITETOOLS-160
>                 URL: https://issues.apache.org/jira/browse/DOXIASITETOOLS-160
>             Project: Maven Doxia Sitetools
>          Issue Type: Improvement
>          Components: Site renderer
>    Affects Versions: 1.7
>            Reporter: Michael Osipov
>            Assignee: Michael Osipov
>             Fix For: 1.8
>
>
> In DOXIASITETOOLS-87 all template line ending is normalied with custom 
> resource loader for Velocity but this is the wrong place because it is not a 
> Velocity problem. This problem is solely at {{SiteRenderer}} side.
> Revert DOXIASITETOOLS-87 and apply this rather simple patch to solve the 
> problem in the correct spot:
> {noformat}
> Index: DefaultSiteRenderer.java
> ===================================================================
> --- DefaultSiteRenderer.java  (revision 1733265)
> +++ DefaultSiteRenderer.java  (working copy)
> @@ -701,7 +698,9 @@
>  
>              try
>              {
> -                template.merge( context, writer );
> +                StringWriter sw = new StringWriter();
> +                template.merge( context, sw );
> +                writer.write( sw.toString().replaceAll( "\r?\n", 
> SystemUtils.LINE_SEPARATOR ) );
>              }
>              catch ( Exception e )
>              {
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to