heidkaemper / craft-redactor-anchors

Support for anchors in Craft CMS Redactor
https://plugins.craftcms.com/redactor-anchors
MIT License
10 stars 4 forks source link

Plugin does not recognise file links #11

Closed mihob closed 1 year ago

mihob commented 1 year ago

The plugin does not recognise file links and sets the craft note as an anchor. However, it works correctly with entry links.

If I see it correctly, probably only the following regex needs to be adjusted here:

const pcs = formData.url.match(/^(.*?)(#(?!entry\:[0-9]+).*?)(#entry\:[0-9]+.*)?$/i);

heidkaemper commented 1 year ago

Thanks for reporting!

This should be fixed with version 1.4.1. https://github.com/heidkaemper/craft-redactor-anchors/releases/tag/1.4.1