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

Fragment links with no markers are badly converted to wiki syntax

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1 RC1
    • Fix Version/s: 3.1, 3.2 M1
    • Component/s: Syntax - xwiki/2.0
    • Labels:
      None
    • Similar issues:

      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

              • 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: