seems to be something with the parser dealing with the bbcode size tag closing/adding new paragraph tags for [size]. Other bbcode tags I looked at don’t do this:
bbcode in editor: [b]strong[/b] [i]i[/i] [size=28]test[/size] [i]i[/i] strongi [size=28]test[/size] i
straight html in editor: <strong>strong</strong> <i>i</i> <big>test</big> <i>i</i> strongi test i
When the renderer hits the [size] blocks it closes the p tag and opens a new one which is what’s mangling the formatting.
bbcode rendered result:
`
strongi
test
i
`
html rendered result: <p><br><strong>strong</strong> <i>i</i> <big>test</big> <i>i</i></p>
That is so odd, so it’s the parser not the bbcode? Do you think there would be a easy way to prevent the parser from doing that or add something to the bbcode to prevent it from being rendered that way?
The board is mixing a subset of html, Markdown, and BBCode, I’m kind of amazed that they have as consistent a result as they do with that level of markup mixing.
I haven’t really looked at the source much, but it looks like bbcode part of the message is taking a bbcode specific path since everything getting wrapped in bbcode-styled spans in ways that are different than html/Markdown. I doubt there’s much you could do on the client side other than using the pseudo-html big/small/etc. tags. I haven’t looked at the parser code, though.
I started looking through:
I’m sure if you found wherever the client’s bbcode was getting rendered to html you could find where the paragraphs were getting broken, but I still have the flu, so that isn’t going to be too productive for me.
You are much more skilled in coding comprehension than me but with my very minimal very very basic knowledge that seems very strange, I am even more intrigued to hear what @codinghorror has to say about all of this.com
you can find the bbcode rendering done in JS in:
discourse/app/assets/javascripts/discourse/dialects/bbcode_dialect.js
since the input we’re typing in comments can be either a subset of html, Markdown, or a subset of BBCode when the app get that user input and does the work to render it to html to display in a browser it makes sense to separate out the code that handles html, BBCode, and Markdown, since they are different markup languages.
I assume @codinghorror or @sam could sort out whe [size] is breaking paragraphs pretty easily since they know that codebase.