Skip to content

Bold formatting on partial link text splits single <a> into multiple anchor elements #3292

@Dennis273

Description

@Dennis273

Description

When selecting part of the text inside a hyperlink and applying bold formatting, the single <a> element is split into multiple <a> elements with the same href.

Steps to Reproduce

  1. Open the RoosterJS demo page
  2. Type or paste a URL (e.g., <http://www.google.com>) and let it auto-link
  3. Select part of the link text (e.g., select "google")
  4. Click the Bold button

Expected

<a href="<http://www.google.com>" title="<http://www.google.com>">
  <http://www>.<b>google</b>.com
</a>

Actual

<a href="<http://www.google.com>" title="<http://www.google.com>"><http://www.></a>
<b><a href="<http://www.google.com>" title="<http://www.google.com>">google</a></b>
<a href="<http://www.google.com>" title="<http://www.google.com>">.com</a>

One anchor is split into three. This also applies to other inline formats like italic, underline, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions