Page 1 of 1

BBCode bug?

Posted: Sun Mar 16, 2025 6:53 am
by cday
<!--// Moderator's note: This topic has been split-off from Questions about TIFF-compression //-->

@XnTriq: The unwanted partial italicisation in my first post that you kindly removed is back after I edited the post to remove an unwanted space in my text that I had presumably missed before... :wink:

I have seen something similar once or twice before, and it does seem to arise from some bug in phpBB.

Re: Questions about TIFF-compression

Posted: Sun Mar 16, 2025 7:55 am
by user0
cday wrote: Sun Mar 16, 2025 6:53 am unwanted partial italicisation
add space between [ and i

Code: Select all

aaa [i bbb] ccc
aaa ccc

Re: Questions about TIFF-compression

Posted: Sun Mar 16, 2025 8:10 am
by cday
Thanks, I managed to follow your cryptic instruction with the usual difficulty, and removing the space that was presumably inserted by XnTriq to correct the original issue has removed the unwanted italicisation... :D

But the need for that space surely arises from a bug in phpBB?

Re: Questions about TIFF-compression

Posted: Sun Mar 16, 2025 3:30 pm
by XnTriq
For cases like this, there's the Disable BBCode option.

Re: Questions about TIFF-compression

Posted: Sun Mar 16, 2025 4:00 pm
by cday
I'm focused on the apparent bug, but thanks to user0 for identifying the cause, and to you for the suggested workaround which hopefully I will never need.

Re: BBCode bug?

Posted: Sun Mar 16, 2025 9:30 pm
by XnTriq
https://www.phpbb.com/community/viewtopic.php?p=14948931#p14948931 wrote:The BBCode syntax skips attributes with no values, so [x x] is interpreted as [x]. Illegal characters cause the whole thing to be ignored. You can add your own markup validation via a tag filter. Tag filters can be added via an extension. The return value of tag filters is ignored in s9e\TextFormatter 1.0 but it's required in earlier versions such as the one that ships with phpBB 3.2.2 and earlier.
https://www.phpbb.com/community/viewtopic.php?p=14949131#p14949131 wrote:At some point in the future, I may revise the way this specific example is handled but even if something like [x x] was rejected, something like [­i ] or [­i=1] would remain valid. That's why if a specific implementation of some markup is required, it's best to validate it in a custom filter or maybe even as a custom plugin in some instances.
https://www.phpbb.com/community/viewtopic.php?p=10412465#p10412465 wrote:You could do it by putting a non-printable character after the opening [ of any bbcode you didn't want interpreting:

[­b]BOLD TEXT[­/b] will display BOLD TEXT

if you copy and paste the above line into notepad, it will display as:

[­-b]BOLD TEXT[­-/b] will display BOLD TEXT

the '-' symbols are the non-printable characters (hold down alt and type 240 on the keypad - remember to have num lock on)

Re: BBCode bug?

Posted: Sun Mar 16, 2025 10:08 pm
by cday
Thanks, but I don't see why a workaround should be mandatory in well-designed code... :wink: