Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-117

Fragment links with no markers are badly converted to wiki syntax

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.1, 3.2 M1
    • 3.1 RC1
    • Syntax - xwiki/2.0
    • None

    Description

      If you convert this XHTML:

      <p><a href="http://www.xwiki.org/path#foo">test</a></p>
      

      to XWiki 2.0 syntax, you get:

      [[test>>http://www.xwiki.org/path#foo]]
      

      which is the expected result. But if you convert:

      <p><a href="#foo">test</a></p>
      

      you get:

      [[test>>\#foo]]
      

      As you can see the fragment identifier is escaped. This breaks the links. Note that in both previous examples the link markers are missing. If I add the link markers to the second example it works:

      <p>
        <!--startwikilink:false|-|url|-|#bar-->
        <span class="wikiexternallink">
          <a href="#bar">test</a>
        </span>
        <!--stopwikilink-->
      </p>
      

      The use case for the missing markers is when you import an office document that has internal links (e.g. a table of contents).

      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: