Uploaded image for project: 'Maven Doxia Sitetools'
  1. Maven Doxia Sitetools
  2. DOXIASITETOOLS-160

Normalize line endings in skin template content on SiteRenderer side rather that Velocity side

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7
    • 1.7.1
    • Site renderer
    • None

    Description

      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:

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

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              michael-o Michael Osipov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: