Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-83595

Anchor references are lost using CKEditor in HTML format when using whitespace that is not allowed in ID

    Details

      Description

      Steps to reproduce on vanilla 7.0 patched with de-53:

      1. Go To Control Panel > System Settings > Wiki Service and for HTML editor, set ckeditor
      2. Create a Wiki Page
      3. Select HTML as format
      4. Add the following two lines as content:
      this is an anchor

      this is a link to an anchor

      5. Select the text "this is an anchor", click on the flag icon (anchor) and type "this is an anchor", save it
      6. Select the text "this is a link to an anchor", click on the chain icon (link), change it to Link Type: "Link to anchor in the text", select "by anchor name" and select "this is an anchor"
      7. Source should look like this:
      <p><a id="this is an anchor" name="this is an anchor">this is an anchor </a></p>

      <p><a href="#this is an anchor">this is a link to an anchor</a></p>
      8. Publish Wiki Page

       Actual results: links not working; href, id and their values are lost.

       Additional information:
      According to the html live spec, the id attribute should not have spaces.

      https://html.spec.whatwg.org/#the-id-attribute

      According to the initial tests, the POST already skips the ids having spaces, sending just the <a>whatever</a> to the server. It makes sense if one considers they are forbidden.

       Expected result:
      1) invalid characters should be replaced and the anchorlink should work

       

      Also tested on:

       7.0x @0cb73794770d693dd47f30ebd50a711f9162dd10 -> Same result

       Master @4a26debbd31d6f4b2cc4d44c4a0faf52d46377f2 -> Same result

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 14 weeks, 5 days ago

                Packages

                Version Package
                7.0.0 DXP FP58
                7.0.0 DXP SP9
                7.0.X
                7.1.X
                Master