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

The output of the HTML macro with wiki=true is parsed and generates duplicated content

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.9.2, 2.0 M2
    • 2.0 M1, 1.9.1
    • {Unused} Rendering 2.0
    • None
    • any
    • nested macros
    • Unit
    • Unknown

    Description

      XWiki 2.0 input:

      {{html wiki="true"}}{{velocity}}abc{{/velocity}}{{/html}}
      

      XHTML 1.0 output:

      <!--startmacro:html|-|wiki="true"|-|{{velocity}}abc{{/velocity}}--><!--startmacro:velocity|-||-|abc--><p>abc</p><!--stopmacro--><!--stopmacro-->
      

      XWiki 2.0 output after re-parsing:

      {{html wiki="true"}}{{velocity}}abc{{/velocity}}{{/html}}
      
      {{velocity}}abc{{/velocity}}
      

      Notes:

      • The nested velocity macro generates unnecessary meta data. I though we decided that only the top level macro generates meta data because only that meta data is required to reconstruct the content. For instance, the following
        {{velocity}}{{html}}abc{{/html}}{{/velocity}}
        

        doesn't generate meta data for the nested HTML macro:

        <!--startmacro:velocity|-||-|{{html}}abc{{/html}}--><p>abc</p><!--stopmacro-->
        

        Anyway, I changed the WYSIWYG code to handle nested macro start/stop comments.

      • The velocity macro is duplicated. I suspect this happens because of the nested start/stop velocity macro comments. The output of the HTML macro shouldn't be parsed because all the required information is in the HTML start macro comment.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: