maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Osipov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DOXIASITETOOLS-160) Normalize line ending in skin template content on SiteRenderer side rather that Velocity side
Date Sun, 06 Mar 2016 18:29:40 GMT
Michael Osipov created DOXIASITETOOLS-160:
---------------------------------------------

             Summary: Normalize line ending 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.7.1


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)

Mime
View raw message