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

Using an include macro can generate weird empty paragraphs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 6.2.1
    • Fix Version/s: None
    • Component/s: Macro
    • Labels:
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: