Maven Doxia
  1. Maven Doxia
  2. DOXIA-405

The generated xhtml document has the entire content on a single line

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.3
    • Fix Version/s: 1.4
    • Component/s: Module - Xhtml
    • Labels:
      None
    • Environment:
      Maven Site Plugin 2.1.1
      Windows XP Pro
    • Number of attachments :
      0

      Description

      If you view the source for http://maven.apache.org/plugins/index.html, you will see that the entire content is on line 207 and is 35396 columns wide. Trying to debug such a page is near impossible.

      For very large documents is isn't even possible for some browsers to show the source with that many columns.

        Issue Links

          Activity

          Hide
          Lukas Theussl added a comment -

          See http://maven.apache.org/doxia/faq.html#Why_XML_based_sinks_don_t_generate_nicely_formatted_documents

          I think pretty printing should be done outside doxia, eg in the site plugin or site renderer.

          Show
          Lukas Theussl added a comment - See http://maven.apache.org/doxia/faq.html#Why_XML_based_sinks_don_t_generate_nicely_formatted_documents I think pretty printing should be done outside doxia, eg in the site plugin or site renderer.
          Hide
          Herve Boutemy added a comment -

          ok, real pretty printing, with indentation, should be done outsite
          But having some newlines is useful

          Show
          Herve Boutemy added a comment - ok, real pretty printing, with indentation, should be done outsite But having some newlines is useful
          Hide
          Herve Boutemy added a comment - - edited

          tried to implement it.
          The feature is easy to do:

          Index: src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java
          ===================================================================
          --- src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java	(revision 1196075)
          +++ src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java	(working copy)
          @@ -107,6 +107,12 @@
                   }
           
                   StringBuilder sb = new StringBuilder();
          +
          +        if ( t.isBlock() )
          +        {
          +            sb.append( EOL );
          +        }
          +
                   sb.append( LESS_THAN );
           
                   if ( nameSpace != null )
          

          There are quite a few sink test methods to fix, add EOL ad trimming some results: easy too
          But there is a hard part: identity tests are severely affected, since the newline adds some text before blocks
          I'm stuck...

          Show
          Herve Boutemy added a comment - - edited tried to implement it. The feature is easy to do: Index: src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java =================================================================== --- src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java (revision 1196075) +++ src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java (working copy) @@ -107,6 +107,12 @@ } StringBuilder sb = new StringBuilder(); + + if ( t.isBlock() ) + { + sb.append( EOL ); + } + sb.append( LESS_THAN ); if ( nameSpace != null ) There are quite a few sink test methods to fix, add EOL ad trimming some results: easy too But there is a hard part: identity tests are severely affected, since the newline adds some text before blocks I'm stuck...
          Hide
          Herve Boutemy added a comment -

          done in r1410919

          I did a trick to make the identity test pass: the identity test is run without EOLs addition...

          Show
          Herve Boutemy added a comment - done in r1410919 I did a trick to make the identity test pass: the identity test is run without EOLs addition...

            People

            • Assignee:
              Herve Boutemy
              Reporter:
              Dennis Lundberg
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: