It is currently April 20th, 2024, 4:03 am

["BUG"] Questionable tag matching in the Forum code

Discussions about the documentation, main Rainmeter site and forums.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

["BUG"] Questionable tag matching in the Forum code

Post by Yincognito »

This is simple to demonstrate...


The two snippets above are [​I said] and [​B good]. Despite the [​I and [​B not ending with ] or using lowecase, they are still interpreted as italic and bold text starting tags, turning everything after them accordingly until the [​/i] closing tag is used (which I just did at the end of this sentence).


A workaround is to copy paste the zero-width space character between the [ and the following I or B (or similar for the literal closing tag strings), but that's a bit technical for the regular user and could be solved by matching only [​i] and [​b] in the forum code. If feasible, of course.

P.S. The effect above might be true for other tags I did not test, by the way.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Brian
Developer
Posts: 2679
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: ["BUG"] Questionable tag matching in the Forum code

Post by Brian »

I am not sure this is a bug. I think the bbcode parser treats anything after a space as a parameter to the bbcode itself, like how the quote bbcode has user_id, time, post_id (and other) parameters.

Code: Select all

[quote=Yincognito post_id=214164 time=1681836812 user_id=33362]
I guess you could make the argument that bbcodes that do not accept parameters should error out if a parameter is used. Either way, the developers of phpbb would have to implement this change.

The only other workaround I can think of would be to use the code bbcode, since bbcodes don't seem to parse within a code block.

Code: Select all

[I said]
Another option is to check the "Disable BBCode" checkbox in the Options section of the post....but of course that disables all bbcodes for that post. I am not aware of a "no bbcode" bbcode, like [nobbcode][/nobbcode].

-Brian

PS - bbcodes are case-insensitive, so it won't matter if you use lower, upper or even mixed case.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ["BUG"] Questionable tag matching in the Forum code

Post by Yincognito »

Brian wrote: April 21st, 2023, 8:28 pm I am not sure this is a bug. I think the bbcode parser treats anything after a space as a parameter to the bbcode itself, like how the quote bbcode has user_id, time, post_id (and other) parameters.

Code: Select all

[quote=Yincognito post_id=214164 time=1681836812 user_id=33362]
I guess you could make the argument that bbcodes that do not accept parameters should error out if a parameter is used. Either way, the developers of phpbb would have to implement this change.

The only other workaround I can think of would be to use the code bbcode, since bbcodes don't seem to parse within a code block.

Code: Select all

[I said]
Another option is to check the "Disable BBCode" checkbox in the Options section of the post....but of course that disables all bbcodes for that post. I am not aware of a "no bbcode" bbcode, like [nobbcode][/nobbcode].

-Brian

PS - bbcodes are case-insensitive, so it won't matter if you use lower, upper or even mixed case.
Ah, I see, the parameter reason makes perfect sense, didn't think about that. Couldn't use code tags in this case since I specifically needed text coloring, so the only option was to use the zero-width space. I resort to such tricks in Rainmeter too, when I want to preserve the otherwise trimmed spaces at the beginning and ending of an option, by the way. I only mentioned this in case it was a potential issue for users less familiar with these methods. Thanks for taking a look at it and for the explanation. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth