Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty links with href but no label are not removed by empty tags cleanup #436

Open
jamesmacwhite opened this issue Oct 20, 2022 · 0 comments
Labels

Comments

@jamesmacwhite
Copy link

Description

We have found occurrences of invalid HTML in redactor fields such as this example:

<p>Some example paragraph text <a href="url/something.pdf#asset:5902:url"></a><a href="url/something.pdf#asset:5904:url"></a><a href="url/something.pdf#asset:170586:url"></a><a href="url/something.pdf#asset:192253:url">some text linked</a>.</p>

There were several empty anchor tags without a label when viewing the HTML source for the redactor field data.

It would appear that the original link has changed one or more times but the original linked href value changing left the original anchor without a label in place, while adding a correct link with the label set.

The cleanup option for empty tags only matches on <a></a> it doesn't match the case for something like <a href="url"></a>.

How the situation occurred with empty links is an interesting one, but could the cleanup regex be expanded to cover this scenario potentially?

Steps to reproduce

  1. Add an empty link with a href but no label e.g. <a href="https://www.google.co.uk"></a>
  2. Observe this will be present in the redactor field but without any indication of it's presence in the CMS when saving.

Additional info

  • Craft version: 3.7.56
  • PHP version: 8.0
  • Database driver & version: MySQL
  • Plugins & versions: Redactor 2.10.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant