Advertisement:

Author Topic: bad bbcode: size/center  (Read 4604 times)

Offline rejetto

  • Semi-Newbie
  • *
  • Posts: 25
bad bbcode: size/center
« on: November 06, 2008, 06:35:21 AM »
look
Code: [Select]
[size=20pt][center]test[/center][/size]output
test
[/size]

you are supposed to not see the 'size' tag here above, right?

while
Code: [Select]
[center][size=20pt]test[/size][/center]works
test


as far as i can see, this bug applies to 2.0b4 (that's here, right now :D)

Offline Kermit

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,365
  • Gender: Male
Re: bad bbcode: size/center
« Reply #1 on: November 06, 2008, 06:37:45 AM »
this is not a bug m8,your bbc code order is wrong by the 1st 1

try it via html code,that would not work too

first set the size tag and than the center tag
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,210
  • Mind the volcano!
    • curiousdannii on GitHub
Re: bad bbcode: size/center
« Reply #2 on: November 06, 2008, 07:10:01 AM »
center is a block level code, but size is an inline level code. If you try to put a block level tag inside an inline tag it will automatically close all the previous inline tags first.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline rejetto

  • Semi-Newbie
  • *
  • Posts: 25
Re: bad bbcode: size/center
« Reply #3 on: November 06, 2008, 07:22:09 AM »
try it via html code,that would not work too

i tried: it works with current versions of firefox, ie and opera.
you can check yourself
www.rejetto.com/temp/test.html

center is a block level code, but size is an inline level code. If you try to put a block level tag inside an inline tag it will automatically close all the previous inline tags first.

is this a rule of SMF or HTML?
if the latter, i didn't know it, and browsers seems to not be caring of it.

thank you for your time :)

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,210
  • Mind the volcano!
    • curiousdannii on GitHub
Re: bad bbcode: size/center
« Reply #4 on: November 06, 2008, 07:29:08 AM »
SMF wants to produce valid HTML, so it's a bit of both.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."