Anchor tag class gets removed when image tag is present as its child elements

Created on 24 October 2024, 22 days ago

Problem/Motivation

The classess anchor tag() gets removed when the image tag() is present as its child element. The removed class is added to the image tag when no class is present initially in the image tag. However, when the image tag has any class, the anchor tag class gets removed completely.

Steps to reproduce

1. Create a formatted text field in any content type and allow the text format to be full HTML.
2. Now add the below structure in the above-created field in source editing.

<p class="mb-0">
  <a class="button" href="#" aria-label="learn more">Learn More <img src="image/one.png" alt="Visit" width="16" height="11"></a>
</p>

3. Now close the source editing view and again click on the source editing view then you will find that the above structure has been changed into the below structure.

<p class="mb-0">
  <a href="#" aria-label="learn more">Learn More <img class="button" src="image/one.png" alt="Visit" width="16" height="11"></a>
</p>
🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇮🇳India deepak5423

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024