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

XWiki 2.0 renderer doesn't escape ~ in image reference

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.2.6
    • Fix Version/s: 2.4 M1, 2.3.2
    • Component/s: {Unused} Rendering 2.0
    • Labels:
      None
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      The following XWiki 2.0 syntax:

      [[image:http://thor.info.uaic.ro/~~evalica/img/x_logo_xwiki.png]]
      

      (notice that we have to escape the ~, otherwise the URL of the external image is badly parsed) generates this HTML comment:

      <!--startimage:http://thor.info.uaic.ro/~evalica/img/x_logo_xwiki.png-->
      

      As expected, ~ is not escaped because the escaping was specific to XWiki 2.0 syntax (~ is not necessarily a special symbol in other syntaxes). When this HTML comment is transformed back to XWiki 2.0 syntax (e.g. when saving the page in WYSIWYG mode) the result is:

      [[image:http://thor.info.uaic.ro/~evalica/img/x_logo_xwiki.png]]
      

      As you can see ~ not escaped anymore and the image URL is badly parsed as a result.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: