BBcode specifying code in small font not working

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
martinknafve
Registered User
Posts: 2
Joined: Sun Feb 25, 2018 7:18 pm

BBcode specifying code in small font not working

Post by martinknafve » Sun Feb 25, 2018 7:37 pm

In phpBB 3.1, the following bbcode displayed the text YYY and the code ZZZ in a small font.

[size=85]YYY[code]ZZZ[/code][/size]

In phpBB 3.2.2, it instead shows the equivalent of:

[size=85]YYY[/size][code]ZZZ[/code][/size]

In other words, the initial text YYY is smaller, but the code is normal-sized and then there's a trailing [/size]-tag.

This issue seems very similar to the one brought up here:
viewtopic.php?f=556&t=2414901&p=14692146#p14690321
https://tracker.phpbb.com/browse/PHPBB3-14790

I wonder if anyone knows if this is a bug, and in that case if it's already reported. I've of course tried to find a bug report in JIRA but without any luck.

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7346
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: BBcode specifying code in small font not working

Post by JimA » Sun Feb 25, 2018 7:48 pm

Hi, welcome to phpBB.com! :)

The issue is likely related to the topics and bug report you mention, because the BBcode parser has been changed in 3.2 to be a bit stricter with regards to invalid HTML. Maybe the developer, JoshyPHP, of the new parser could shed some light on your issue?

JoshyPHP wrote:mention
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

User avatar
JoshyPHP
Code Contributor
Posts: 949
Joined: Mon Jul 11, 2011 12:28 am

Re: BBcode specifying code in small font not working

Post by JoshyPHP » Sun Feb 25, 2018 7:56 pm

[code] produces a div element and [size] produces a span element, which does not allow div descendants as per the HTML specifications. Instead of producing invalid HTML, it closes the span element.
I wrote the thing that does BBCodes in 3.2.

martinknafve
Registered User
Posts: 2
Joined: Sun Feb 25, 2018 7:18 pm

Re: BBcode specifying code in small font not working

Post by martinknafve » Sun Feb 25, 2018 8:26 pm

Reading the bbcode guide in the help, there's no mentioning of spans or divs. I'm not sure it makes sense that an author using bbcode should understand the intricacies of the output elements and how the bbcode parser behavior changes from version to version in relation to these.

Do I understand it right that this is as-designed, and there are no plans to change it?

Where can I read about these breaking changes?

Also, is there some guidance on how to handle this type of issue when the forum has hundreds of thousands of posts?

Thanks!

User avatar
JoshyPHP
Code Contributor
Posts: 949
Joined: Mon Jul 11, 2011 12:28 am

Re: BBcode specifying code in small font not working

Post by JoshyPHP » Sun Feb 25, 2018 9:19 pm

Yes, this is the expected behaviour with no immediate plans to change it.

My best guess would be nowhere. There are no formal specifications for the markup used in phpBB, only a handful of regression tests. To be honest, I don't think too many people would care to read it.

I don't know. If you feel brave you can perform a search/replace over the database's content but I wouldn't recommend it unless you know exactly what you're doing.
I wrote the thing that does BBCodes in 3.2.

User avatar
AmigoJack
Registered User
Posts: 5315
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: BBcode specifying code in small font not working

Post by AmigoJack » Mon Feb 26, 2018 9:04 am

JoshyPHP wrote:
Sun Feb 25, 2018 7:56 pm
[code] produces a div element
Is there a need for this? A span can act like a div (and vice versa), too. Rendering [code] additionally makes use of p and pre (apparently straight from the W3C example), but those behaviours can be achieved thru inline elements with additional CSS attributes as well, which would not result in block/inline collisions.

Or in other words: if the parser is intelligent enough to discover this case, why not applying what size was about to render to the code rendering? For pre-defined BBCodes this would be trivial in most cases.
The worst thing about censorship is ███████████

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: </Solidjeuh>, Bing [Bot], DaErwin, hewmac06, invenio, Lady_G, Lumpy Burgertushie, nugai, sakm and 34 guests