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

new problem with {{velocity}}+{{html}} (certainly since {{html wiki="false"}} by default)

    XMLWordPrintable

Details

    • syntax,2.0,macro,velocity,html
    • Unit
    • Unknown

    Description

      The code is directly compiled from current trunk.

      I write a simple wiki page such as:

      {{velocity}}
      {{html}}
      #warning("(% style='font-size:120%' %) [[mylink>>myspace.mypage]]")
      {{/html}}
      {{/velocity}}
      


      and I get the following rendered text:

      (% style='font-size:120%' %) [[mylink>>myspace.mypage]]
      

      The content in the velocity macro is not rendered.
      Ok apparently now, the default parameter is:

      {{html wiki="false"}}
      

      So I modify the page:

      {{velocity}}
      {{html wiki="true"}}
      #warning("(% style='font-size:120%' %) [[mylink>>myspace.mypage]]")
      {{/html}}
      {{/velocity}}
      

      And I get following exception:

      ...
      
      org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getRenderedContent' in  class com.xpn.xwiki.api.Document threw exception java.lang.StackOverflowError @ /templates/preview.vm[6,7]
      
      ...
      
      Caused by: java.lang.StackOverflowError
      	at org.xwiki.rendering.renderer.printer.MonitoringWikiPrinter.print(MonitoringWikiPrinter.java:41)
      	at org.xwiki.rendering.renderer.printer.XMLWikiPrinter.print(XMLWikiPrinter.java:79)
      
      	at org.xwiki.rendering.renderer.printer.WrappingWikiPrinter.print(WrappingWikiPrinter.java:39)
      	at org.xwiki.rendering.renderer.printer.MonitoringWikiPrinter.print(MonitoringWikiPrinter.java:41)
      	at org.xwiki.rendering.renderer.printer.XMLWikiPrinter.print(XMLWikiPrinter.java:79)
      
      	at org.xwiki.rendering.renderer.printer.WrappingWikiPrinter.print(WrappingWikiPrinter.java:39)
      	at org.xwiki.rendering.renderer.printer.MonitoringWikiPrinter.print(MonitoringWikiPrinter.java:41)
      	at org.xwiki.rendering.renderer.printer.XMLWikiPrinter.print(XMLWikiPrinter.java:79)
      
      ...
      

      Kind of infinite loop...

      I have tried other combinations with html before velocity, inside warning macro etc... but never works as it should...

      For example:

      {{velocity}}
      #warning("{{html wiki="true"}}(% style='font-size:120%' %) [[mylink>>myspace.mypage]]{{html}}")
      {{/velocity}}
      

      renders:

      <div class="infomessage">mylink</div>
      
      - with right formatting for "mylink" (<a> link inside a <span> with right font size).
      - "<div class="infomessage"></div>" is not considered as HTML but as plain text as expected.
      

      It means the content of the warning velocity macro is "wiki"-rendered but the problem seems to be the behavior of the html macro.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            pascal.voitot Pascal Voitot
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: