Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-368

Using an include macro can generate weird empty paragraphs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • None
    • 6.2.1
    • Macro
    • N/A
    • N/A

    Description

      The following xwiki/2.1 syntax code:

      {{include reference="DoesNotMatterIfExistsOrNot"/}}{{velocity}}
      hi
      (((ho)))
      {{/velocity}}
      

      generates the following html output:

      <p></p>      <--- why?
      <p>hi</p>
      <div><p>ho</p></div>
      <p></p>      <--- why?
      

      The problem seems to occur when the include macro is used next to the velocity macro (possibly other inline macros that support wiki syntax?) and inside that macro, a group is defined.

      Those empty paragraphs generated before and after the include-velocity macro pair can cause HTML validation problems

      Note: when the included document does exist and contain content, the output is this:

      <p></p>          <--- why?
      <p>aa</p>        <--- content of the included document
      <p>hi</p>
      <div><p>ho</p></div>
      <p></p>          <--- why?
      

      Workaround for getting rid of the paragraphs:

      ((({{include reference="DoesNotMatterIfExistsOrNot"/}}{{velocity}}
      hi
      (((ho)))
      {{/velocity}})))
      

      obviously outputs:

      <div>
        <p>hi</p>
        <div><p>ho</p></div>
      </div>
      

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              enygma Eduard Moraru
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: