craftcms / redactor

Edit rich text content in Craft CMS using Redactor by Imperavi.
https://plugins.craftcms.com/redactor
MIT License
100 stars 49 forks source link

Text linking issues #379

Closed mortscode closed 2 years ago

mortscode commented 2 years ago

Description

Experiencing an issue when we select text and link it to an entry. Particularly when linking multiple list items to different entries.

Steps to reproduce

  1. Add a list of items to a redactor rich text field
  2. Select and convert the items into a bulleted list
  3. Select the first bullet and link it to an entry
  4. Select the second bullet and link it to a different entry

-- At this point, we're noticing that the 1st bullet is replaced by the 2nd bullet's link and the 2nd bullet remains unchanged.

Additional info

mortscode commented 2 years ago

I rolled Redactor back to v2.10.4 and the problem persists.

mortscode commented 2 years ago

https://user-images.githubusercontent.com/3239582/159305485-58294420-f73f-480d-bdbb-f1fc22099b35.mov

mortscode commented 2 years ago

Here's my Redactor config for that field:

{
    "buttons": [
        "formatting",
        "bold",
        "italic",
        "underline",
        "lists",
        "link",
        "html"
    ],
    "formatting": ["p"],
    "formattingAdd": {
        "headline": {
            "title": "H2",
            "api": "module.block.format",
            "args": {
                "tag": "h2",
                "class": "post-text__headline"
            }
        },
        "subhead": {
            "title": "H3",
            "api": "module.block.format",
            "args": {
                "tag": "h3",
                "class": "post-text__subhead"
            }
        }
    },
    "linkNewTab": true,
    "toolbarFixed": true
}
mortscode commented 2 years ago

The problematic behavior persists with any list or even non-bulleted items that are on separate lines. However, within a single paragraph, i can select text and link it and then select different text (within the same paragraph) and the linking goes as expected.

With this in mind, I am able to select text in a list item and link it as expected on the condition that I don't select ALL of the text.

Like so:

https://user-images.githubusercontent.com/3239582/159378890-b1e0aa88-0bd3-47d7-b2cf-8e4e26bdec94.mov

andris-sevcenko commented 2 years ago

Thanks for reporting that! This is a duplicate of #374 that we haven't yet been able to solve.