- Issue created by @Styx1983
- Merge request !12Issue #3460457 by Styx1983: Rework the Suggestion for CKEditor Anchor Link Matcher class for LinkIt → (Open) created by Styx1983
I tried to use the current implementation of the AnchorLinkMatcher and wasn't really happy with the limitations to the current page and the behavior to just add a "#" to the search string, so I tried to make it usable from everywhere. The module is partially based on the existing EntityMatcher and NodeMatcher provided by Linkit.
The downside of my current solution is the amount and, in bigger systems, the complexity of the created database queries, especially when paragraphs are used. I added the configuration parameter "recursion_active" and "recursion_depth" to the config page of the matcher to mitigate this problem. My prefered solution would have been to add tracking for created and removed anchor links within the database to get rid of the flexible detection and thereby to make the complexity of the query foreseeable, but this kind of solution would have needed more changes to your module.
- Discovered: field_text (Textfield)
- Discovered: field_content (Paragraph)
referencing field_text (Textfield)
- NOT Discovered: field_content (Paragraph)
referencing field_structured_content (Paragraph)
referencing field_text (Textfield)
- Depth 1: field_text (Textfield)
- Depth 1: field_content (Paragraph)
referencing field_text (Textfield)
- Depth 2: field_content (Paragraph)
referencing field_structured_content (Paragraph)
referencing field_text (Textfield)
- Depth 3: field_content (Paragraph)
referencing field_structured_content (Paragraph)
referencing field_more_structured_content (Paragraph)
referencing field_text (Textfield)
Within a textfield with enabled CKEditor and enabled LinkIt-Button.
I'll try to create a merge request containing my suggested rework. Either it is deemed to be suitable for your module - then it can be added - or you do not like the suggestion and reject the merge request.
Needs review
3.0
Code