Skip to content

Unnecessary <p> tag being added into <dt> and <dd> elements #20055

@A-Kun

Description

@A-Kun

📝 Provide detailed reproduction steps (if any)

  1. Visit https://ckeditor.com/docs/ckeditor5/latest/features/source-editing/source-editing.html
  2. Toggle on Source mode
  3. Paste in the following HTML:
<p>Cryptids of Cornwall:</p>

<dl>
  <dt>Beast of Bodmin</dt>
  <dd>A large feline inhabiting Bodmin Moor.</dd>

  <dt>Morgawr</dt>
  <dd>A sea serpent.</dd>

  <dt>Owlman</dt>
  <dd>A giant owl-like creature.</dd>
</dl>

(Example taken from https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dl)

  1. Toggle off and on Source mode

✔️ Expected result

What is the expected result of the above steps?

The HTML markup should remain unchanged.

❌ Actual result

What is the actual result of the above steps?

The HTML markup turns into the following:

<p>
    Cryptids of Cornwall:
</p>
<dl>
    <dt>
        <p>
            Beast of Bodmin
        </p>
    </dt>
    <dd>
        <p>
            A large feline inhabiting Bodmin Moor.
        </p>
    </dd>
    <dt>
        <p>
            Morgawr
        </p>
    </dt>
    <dd>
        <p>
            A sea serpent.
        </p>
    </dd>
    <dt>
        <p>
            Owlman
        </p>
    </dt>
    <dd>
        <p>
            A giant owl-like creature.
        </p>
    </dd>
</dl>

📃 Other details

  • Browser: Firefox 140.9.0esr
  • OS: macOS 14.8.5
  • CKEditor version: 48.0.0

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugThis issue reports a buggy (incorrect) behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions