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

Error when rendering links to images

    XMLWordPrintable

Details

    • rendering, image link
    • Unit

    Description

      Currently in xwiki 2.0 syntax we represent an image link by [[image:attach.png>>http://xwiki.org]]. This works perfectly fine as is indicated by the following test case which passes :

      .#-----------------------------------------------------
      .input|xwiki/2.0
      .#-----------------------------------------------------
      [[image:attach.png>>http://xwiki.org]]
      .#-----------------------------------------------------
      .expect|event
      .#-----------------------------------------------------
      beginDocument
      beginParagraph
      beginLink [Reference = [http://xwiki.org]] [false]
      onImage: [attach.png] [true]
      endLink [Reference = [http://xwiki.org]] [false]
      endParagraph
      endDocument
      .#-----------------------------------------------------
      .expect|xhtml
      .#-----------------------------------------------------
      <p><!--startwikilink:http://xwiki.org--><span class="wikiexternallink"><a href="http://xwiki.org"><!--startimage:attach.png--><img src="/xwiki/bin/download/currentdoc/attach.png" class="wikimodel-freestanding"/><!--stopimage--></a></span><!--stopwikilink--></p>
      

      But when we switch the input with output as in :

      .#-----------------------------------------------------
      .input|xhtml/1.0
      .#-----------------------------------------------------
      <html><p><!--startwikilink:http://xwiki.org--><span class="wikiexternallink"><a href="http://xwiki.org"><!--startimage:attach.png--><img src="/xwiki/bin/download/currentdoc/attach.png" class="wikimodel-freestanding"/><!--stopimage--></a></span><!--stopwikilink--></p></html>
      .#-----------------------------------------------------
      .expect|event
      .#-----------------------------------------------------
      beginDocument
      beginParagraph
      beginLink [Reference = [http://xwiki.org]] [false]
      onImage: [attach.png] [true]
      endLink [Reference = [http://xwiki.org]] [false]
      endParagraph
      endDocument
      .#-----------------------------------------------------
      .expect|xwiki
      .#-----------------------------------------------------
      [[image:attach.png>>http://xwiki.org]]
      

      The test fails. This indicates that the xhtml->xwiki 2.0 parser has a problem with rendering image links.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            asiri Asiri Rathnayake
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: