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

XHTML parser fails to recognize properly the type of links

    Details

    • Tests:
      Integration
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      For example if we have as input:

      <a href="something#other">
      

      We wrongly consider it of type "url" whereas it should be considered of type "path".

      Here's what I'm implementing:

          /**
           * Recognize the passed reference and figure out what type of link it should be:
           * <ul>
           *   <li>UC1: the reference points to a valid URL, we return a reference of type "url",
           *       e.g. {@code http://server/path/reference#anchor}</li>
           *   <li>UC2: the reference is not a valid URL, we return a reference of type "path",
           *       e.g. {@code path/reference#anchor}</li>
           *   <li>UC3: there is an anchor but no reference, we return a reference of type "doc",
           *       e.g. {@code #anchor}. In this case we point to the current content. </li>
           *   <li>UC4: the reference is empty, we return a reference of type "doc". In this case we point to the current
           *       content. </li>
           * </ul>
           *
           * @param rawReference the full reference (e.g. "/some/path/something#other")
           * @return the properly typed {@link ResourceReference} matching the use cases
           */
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vmassol Vincent Massol
                Reporter:
                vmassol Vincent Massol
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: