Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-4477

Using velocity macros in syntax 2.0 are trimmed of any white space leaving html source code unindented

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Trivial
    • None
    • 2.0
    • {Unused} Rendering 2.0
    • None
    • XWiki Enterprise 2.0
    • velocity macros in syntax 2.0
    • Unknown

    Description

      When using a wiki page in syntax 2.0 as a container for velocity macros, the contents are trimmed of white spaces. This will not indent anymore the rendered html content. Also inside html macro you need a empty line so that the contents are not displayed on the same line.

      Page MyModule.Macros

      {{velocity output="false" "filter="none"}}
      #macro(display_document_comments $doc)
      <div>
        <p>COMMENTS</p>
        <p>ANOTHER ONE</p>
      </div>
      #end
      {{/velocity}}
      

      Page MyModule.ClassSheet

      {{velocity output="true" filter="none"}}
      {{html clean="false"}}
      
          <div><p>GUGU</p></div>
            <div><p>another one</p></div>
      {{/html}}
      $xwiki.includeForm("MyModule.Macros")
      #set($document = "Socracy.AnotherTest")
      {{html}}
      
        #display_document_comments($document)
      {{/html}}
      {{/velocity}}
      

      Rendered output, html source:

          <div><p>GUGU</p></div>
            <div><p>another one</p></div>
      <div>
      <p>COMMENTS</p>
      <p>ANOTHER ONE</p>
      </div>
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            flavius.olaru Flavius Olaru
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: