Closed (fixed)
Project:
Extensible BBCode
Version:
8.x-3.x-dev
Component:
Custom tags
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Sep 2019 at 13:05 UTC
Updated:
3 Jun 2020 at 15:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nicholasthompsonPatch attached.
Comment #3
cburschkaI don't think a regex flag in that pattern will have the desired effect. Even after the tag tokens have been identified, the tree is built by matching tag names to registered plugins, and opening tags to closing tags. All of these are still case-sensitive.
We can lower-case all the tag names after parsing, but it's not trivial - for example, we want to ensure that broken tags are printed as they were entered: if [IMG] occurrs and isn't closed, it should remain [IMG] rather than being turned into [img].
Comment #4
nicholasthompsonInteresting point RE unclosed ones not being changed...
However the Regex does work... or at least it's working on the site I'm using this patch on ;) (I was surprised tbh that it did work, in terms of replacement - I fully expected it to work for detection).
The case of the opening and closing tags would need to match; is a concern here if I did
[IMG]thingy.jpg[/img]?Comment #5
cburschkaThis one parses/matches tags case-insensitively, while keeping the original values of opening and closing tags. (This means {{ tag.outerSource }}, {{ tag.openingName }} and {{ tag.closingName }} can be used to print the original values.)
Comment #7
cburschka