Size bug when nested into multiple [size] tags (found by Gumboots)

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Ideas Centre
Post Reply
User avatar
[Dimetrodon]
Registered User
Posts: 438
Joined: Tue Aug 30, 2022 3:29 am
Location: Paleozoic Era
Contact:

Size bug when nested into multiple [size] tags (found by Gumboots)

Post by [Dimetrodon] »

Gumboots wrote: Tue Mar 14, 2023 11:11 pm That reminds me: there is a bug* with nested font-size tags, that renders the default 200% limit ineffective. I'm not sure if this bug has been reported yet. It's easy to get around with CSS (in the absence of a core fix).

Code: Select all

/* Restrict nested font-size tags to 200% maximum. */
/* The following code works for a 200% outer tag. */
/* Can be expanded to cover all larger than default sizes. */
span[style*="font-size:20"] span[style*="font-size"] {
	font-size: 1.625rem !important;
}
*Well, it seems like a bug, but it may be intended behaviour.

Code: Select all

[size=200]Example[/size]

[size=200][size=200]Example[/size][/size]

[size=200][size=200][size=200]Example[/size][/size][/size]

[size=200][size=200][size=200][size=200]Example[/size][/size][/size][/size]
Example

Example

Example
Just quoting this here as this was originally posted in Test Me and I do not want it to be pruned.
Last edited by Mick on Thu Mar 16, 2023 1:15 pm, edited 1 time in total.
Reason: Solved.
Avatar by someone named AdmiralRA on Reddit. (No, I don't have a Reddit account)
When seeking support, please consider filling out the Support Request Template. It makes it easier for anyone trying to help.
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by warmweer »

Not sure if it's really a bug: more like an unforeseen feature ;-)

[size=x]content [/size] x is limited to 200 but there no control over the size of the content
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Gumboots
Registered User
Posts: 692
Joined: Fri Oct 11, 2019 1:59 am

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by Gumboots »

Depends how the devs want to look at it. It can be annoying when idiots abuse it, which is why I threw a bit of CSS at it to annoy the idiots.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72339
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by KevC »

-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26502
Joined: Fri Aug 29, 2008 9:49 am

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by Mick »

Historically there have been nesting issues see this one from 2017 https://tracker.phpbb.com/browse/PHPBB3-15066 there are more if you care to search the tracker. Making a fresh entry in the tracker is a good idea.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
[Dimetrodon]
Registered User
Posts: 438
Joined: Tue Aug 30, 2022 3:29 am
Location: Paleozoic Era
Contact:

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by [Dimetrodon] »

Avatar by someone named AdmiralRA on Reddit. (No, I don't have a Reddit account)
When seeking support, please consider filling out the Support Request Template. It makes it easier for anyone trying to help.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26502
Joined: Fri Aug 29, 2008 9:49 am

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by Mick »

👍🏼 I’ll mark this solved then.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
Gumboots
Registered User
Posts: 692
Joined: Fri Oct 11, 2019 1:59 am

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by Gumboots »

The solution currently proposed on the bug tracker seems to me to be to be overly convoluted.

The problem can be fixed with a few bytes of CSS.

Code: Select all

span[style*="font-size"] span[style*="font-size"]{font-size:100% !important;}
That's all it needs. Will work in every case. Yes, I have tested it live.

Result will be that the displayed font-size is equal to that specified by the outermost tag.

IOW, 200% > 200% > 200% will display as 200%. 150% > 200% > 85% will display as 150%. Etc.

See https://talkrational.org/tikal/viewtopi ... 837#p64837 for a live example.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
User avatar
[Dimetrodon]
Registered User
Posts: 438
Joined: Tue Aug 30, 2022 3:29 am
Location: Paleozoic Era
Contact:

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by [Dimetrodon] »

Which CSS file should I put that in though?
Avatar by someone named AdmiralRA on Reddit. (No, I don't have a Reddit account)
When seeking support, please consider filling out the Support Request Template. It makes it easier for anyone trying to help.
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by GanstaZ »

As i see it there are 2 ways.. If you have a child template that is maintained by you, then decision is up to you.
Another way is to make a simple extension.
root/ext/vendor/package
In package aka extension name.. there should be composer.json (it will enable/disable extension in acp) + styles/theme for main.css.
Easy way to create needed files/folders is to use skeleton extension on develop environment or to use an online version of it.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
Gumboots
Registered User
Posts: 692
Joined: Fri Oct 11, 2019 1:59 am

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by Gumboots »

[Dimetrodon] wrote: Mon Mar 20, 2023 11:19 am Which CSS file should I put that in though?
It's purely a matter of convenience. Put it in any file. It's not something that will run into cascade problems.

For example, I was already running my own extension (which adds top/bottom buttons to the left side of every page) so I just added the extra bit of css to an event there (overall_header_stylesheets_after.html):

Code: Select all

<!-- INCLUDECSS @gumboots_topbottomlinks/topbottomlinks.css -->
<style>span[style*="font-size"] span[style*="font-size"]{font-size:100% !important;}</style>
Yes, I know. Naughty evil inline styles. Bad Gumboots. In this case it was a sensible option. The site is running Prosilver plus 3 custom styles. Putting it here meant I didn't have to add it to the CSS for all styles.
Last edited by Gumboots on Mon Mar 20, 2023 10:12 pm, edited 1 time in total.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
User avatar
[Dimetrodon]
Registered User
Posts: 438
Joined: Tue Aug 30, 2022 3:29 am
Location: Paleozoic Era
Contact:

Re: Size bug when nested into multiple [size] tags (found by Gumboots)

Post by [Dimetrodon] »

Thank you both.

I was going to just edit the style but I went the little extension route considering that it would automatically apply to all prosilver based styles rather than having to edit a bunch of files manually.
Avatar by someone named AdmiralRA on Reddit. (No, I don't have a Reddit account)
When seeking support, please consider filling out the Support Request Template. It makes it easier for anyone trying to help.
Post Reply

Return to “phpBB Discussion”