You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2016/03/06 21:15:40 UTC
[jira] [Updated] (DOXIASITETOOLS-160) Normalize line endings in
skin template content on SiteRenderer side rather that Velocity side
[ 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)