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

Michael Osipov commented on DOXIASITETOOLS-87:
----------------------------------------------

Here is a cheap solution:

{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}

Newline tests pass.

Are you OK with a new improvement issue and code replace?

> inconsistent newlines between template content from skin and generated content
> ------------------------------------------------------------------------------
>
>                 Key: DOXIASITETOOLS-87
>                 URL: https://issues.apache.org/jira/browse/DOXIASITETOOLS-87
>             Project: Maven Doxia Sitetools
>          Issue Type: Bug
>          Components: Site renderer
>            Reporter: Hervé Boutemy
>            Assignee: Hervé Boutemy
>             Fix For: 1.6
>
>
> template from skin artifact is read with newline set from skin artifact 
> builder
> then content is added into it with current newline, which can be different 
> from artifact builder
> Template newline should be harmonized with current newline
> this causes MSITE-121 and requires hack in 
> [maven-scm-publish-plugin|http://maven.apache.org/plugins/maven-scm-publish-plugin/]
>  ([copyAndNormalizeNewlines( File srcFile, File destFile 
> )|http://maven.apache.org/plugins-archives/maven-scm-publish-plugin-1.0-beta-2/xref/org/apache/maven/plugins/scmpublish/ScmPublishPublishScmMojo.html#180])



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

Reply via email to