BBCode bug?

General info, hints, guidelines and rules for all XnView forums. Guests and new users please read here first.

Moderators: helmut, XnTriq, xnview

cday
XnThusiast
Posts: 4356
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

BBCode bug?

Post 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.
User avatar
user0
XnThusiast
Posts: 2294
Joined: Sat May 09, 2015 9:37 am

Re: Questions about TIFF-compression

Post 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
cday
XnThusiast
Posts: 4356
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Questions about TIFF-compression

Post 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?
User avatar
XnTriq
Moderator & Librarian
Posts: 6501
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Questions about TIFF-compression

Post by XnTriq »

For cases like this, there's the Disable BBCode option.
cday
XnThusiast
Posts: 4356
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Questions about TIFF-compression

Post 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.
User avatar
XnTriq
Moderator & Librarian
Posts: 6501
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: BBCode bug?

Post 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)
cday
XnThusiast
Posts: 4356
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: BBCode bug?

Post by cday »

Thanks, but I don't see why a workaround should be mandatory in well-designed code... :wink: