Closed kbergha closed 3 weeks ago
Hi, thanks for getting in touch!
This error comes from CKEditor itself. If you adjust the callback to account for the fact that the URL might be null
, it should start working as expected.
For example: callback: url => url?.match(/[+47]?\d{5}/g),
or you can use this syntax from the docs: callback: url => /[+47]?\d{5}/g.test(url),
.
I hope this helps!
I’ll close this now, but feel free to reach out if you run into any further issues.
Thank you for the fast troubleshooting.
Description
Adding a decorator for links, the unlink feature breaks / causes console errors.
Steps to reproduce
Config options / Decorator code:
Add a link, in this case to
12345
, which matches the regex.See that
ET-phone-home
is added to the anchor element.Try to unlink
Observe console error, "This link has no URL" and that "This is a link" still has link styling.
Console error:
Clicking around creates more console errors. I've clicked the unordered list in this example, but the styling / HTML does not seem to be applied.
Saving the entry, the unordered list HTML/styling from the previous step is applied.
A note to step 2
It does not seem to matter if what you're linking to matches the decorator regex or not. The error happens when linking and unlinking to
https://example.com
as well as long as the decorator is present.Expected behaviour
This is without the decorator.
Click unlink.
Only the previous link text is present. No "This link has no URL", and no link styling / console errors.
Additional info
HTML Purifier config: