I need to use this module to parse some tags from a vbulletin forum which are in the form [IMG2]....[/IMG2].

I cannot enter the upper case token, so configure it with lower case.

I'll upload a patch which makes the tags work case-insensitive.

Comments

nicholasThompson created an issue. See original summary.

nicholasthompson’s picture

Status: Active » Needs review
StatusFileSize
new668 bytes

Patch attached.

cburschka’s picture

I 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].

nicholasthompson’s picture

Interesting 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]?

cburschka’s picture

StatusFileSize
new11.62 KB

This 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.)

  • cburschka committed 277b04b on 4.0.x
    Issue #3080871 by nicholasThompson, cburschka: Case-insensitive tag...
cburschka’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.