Problem/Motivation

When a mailto: link's visible text contains an HTML special character (e.g. <a href="mailto:x@example.com">Life & Work Connections</a>)ObfuscateEmail::process() silently deletes the link's text content. The anchor tag survives, but ends up empty.

<!-- before -->                                                                                                                                                                                                        
<a href="mailto:x@example.com">Life & Work Connections</a>                                                                                                                                                             
                                                                                                                                                                                                                         
<!-- after obfuscate_email filter runs -->                                                                                                                                                                             
<a href="#" data-mail-to="..." data-replace-inner="@email"></a>

Steps to reproduce

1. Enable the "Obfuscate Email" filter on a text format.
2. Create content with a mailto link whose visible text contains an ampersand, e.g.: <a href="mailto:test@example.com">Sales & Support</a>
3. Save and view the rendered output.
4. Observe the anchor tag is present but its inner text has been deleted.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

aaronchristian created an issue. See original summary.

aaronchristian’s picture

Issue summary: View changes
aaronchristian’s picture

Issue summary: View changes

b_sharpe made their first commit to this issue’s fork.

b_sharpe’s picture

Status: Needs review » Fixed

thanks

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.