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

Converting from annotated html to xwiki/2.1 using DefaultHTMLConverter.fromHTML can remove macros

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 15.0
    • WYSIWYG Editor
    • None
    • Unknown

    Description

      Converting from annotated html to xwiki/2.1 using DefaultHTMLConverter.fromHTML can remove macros.

      For instance:

      {{velocity wiki="false"}}
      $services.wysiwyg.fromAnnotatedXHTML('<!--startmacro:paragraphs-numbering|-||-|= H1 =
      
      == H2 ==
      
      = H1 \{\{reference id="HH1"/}} H2 \{\{reference id="HH2"/}} =--><div data-xwiki-non-generated-content="java.util.List&lt;org.xwiki.rendering.block.Block&gt;" class="xwiki-metadata-container"><h1 id="HH1" class="wikigeneratedid wikigeneratedheader"><span>H1</span></h1><h2 id="HH2" class="wikigeneratedid wikigeneratedheader"><span>H2</span></h2><h1 id="HH1H2" class="wikigeneratedid wikigeneratedheader"><span>H1 <!--startmacro:reference|-|id="HH1"--><!--stopmacro--> H2 <!--startmacro:reference|-|id="HH2"--><!--stopmacro--></span></h1></div><!--stopmacro--><!--startmacro:context|-|document="Main.WebHome"|-|= H1 =
      
      == H2 ==
      
      = H1 \{\{reference id="HH1"/}} H2 \{\{reference id="HH2"/}} =
      --><!--stopmacro--><div class="wikimodel-emptyline"></div><h1 id="HH1H2A0" class="wikigeneratedid"><span>H 1 <!--startmacro:reference|-|id="HH1"--><!--stopmacro--> H 2&nbsp; <!--startmacro:reference|-|id="HH2"--><!--stopmacro--></span></h1>', 'xwiki/2.1')
      {{/velocity}}
      

      Returns

      {{paragraphs-numbering}}
      = H1 =
      
      == H2 ==
      
      = H1  H2  =
      {{/paragraphs-numbering}}
      
      {{context document="Main.WebHome"}}
      = H1 =
      
      == H2 ==
      
      = H1 {{reference id="HH1"/}} H2 {{reference id="HH2"/}} =
      
      {{/context}}
      
      
      = H 1 {{reference id="HH1"/}} H 2  {{reference id="HH2"/}} =
       

      The last header in paragraphs-rendering does not contains the expected reference macros

      Could be related to XWIKI-19271?

      Note: the affect version needs to be refined

      Attachments

        Activity

          People

            mleduc Manuel Leduc
            mleduc Manuel Leduc
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: