# BBCode compared to Markdown

• Split off because it was kinda derailing the original topic Feature requests for Vivaldi's new forum, and moved to a different subforum because I wasn't actually making a request for BBCode to return here, just arguing that it has some merits:

Another advantage of Markdown over BBCode (when it comes to learning) is that in Markdown you use identical pairs of characters for enclosing the text that has to be formatted, whereas in BBCode you have to use both opening and closing tags, just like in HTML. That's not too intuitive for people unfamiliar with coding / programming languages...

Perhaps. It is an extra formatting character to learn, but the concept pretty similar to the idea of curly quotes, and while people typing only English may (by now) be used to typing neutral quotation marks much of the time (perhaps having MS Word or whatever automatically curl them), French-writing people would be used to having to type "«[...]»", Spanish writers are accustomed to punctuation like "¡[...]!", etc., so the idea of distinct opening and closing marks isn't familiar only to coders.

As far as my own use, I guess the only thing I miss are color, background-color, and superscript/subscript formatting options, and spoiler tags. (For some of those, I see there are NodeBB plugins, although with such plugins there's always the question of how long they'll be maintained.)

Usually these types of plugins don't require third-party services to work and thus should be operative as long as the forum's script isn't updated or as long as the update doesn't cause some interference with those plugins.

Sometimes a platform like forum software or other CMS does do need an update to stay current with security fixes, though; otherwise you're stuck having to backport such fixes on a ever-diverging fork.

And for what purpose would you need that subscript or superscript text? I'm not claiming that it's completely superfluous, only that it's something that is necessary only in some extremely rare cases. In the vast majority of cases, subscript and superscript are used for numbers.

You know, you can't include tools for everything that users would like to put on forums... There is no perfect balance here, I'm afraid, there'll be always someone complaining about some missing or redundant features...

Ok, yeah, I admit the letters are not needed frequently. It might be different if this forum had a "Help with math homework" section.

Spoiler blocks were pretty frequently used here under Kunena, however. On the other hand, the purpose for which they were mostly used was for avoiding having code blocks take up a lot of vertical space. .topic .posts .content pre elements have a max-height: 350px; now (with overflow scrolling), so that makes up for the lack of spoiler tags to a fair degree. (If instead of making max-height: 350px, the CSS instead said height: 350px; resize: vertical; each would start at 350px but people could drag the corner to expand it further if they wished. On the other hand, that would make some short PRE blocks taller than they need to be.)

One hack one can currently do, (although the collapsing isn't evident in preview) is to nest two block quotes as a spoiler.

spoiler
...
...

Again, overall I'm pretty ok with Markdown. I think I slightly prefer BBCode on forums, but given that Markdown is apparently NodeBB's default, it doesn't seem worth the administrators' effort to change that yet again. (They may have even already considered using a BBCode plugin to begin with, since that could have smoothed the import from Kunena, but decided against it.)

• BBCode? Is there a standard? No.
As i can see on different forums the syntax for creation of URLs with link text is different and faulty. And if you miss something or dont close a BBCode all gets unreadable. And some BBCode parsers repair to worse BBCode. And typing BBCode by hand is like hell if there is missing a good comment editor.

Markdown is better to remember, but i think Textile can have more, formatting which is missing in BBCode or Markdown.

• I wasn't actually making a request for BBCode to return here, just arguing that it has some merits

It does have "some merits", nobody was ever questioning that... 😉

It is an extra formatting character to learn, but the concept pretty similar to the idea of curly quotes, and while people typing only English may (by now) be used to typing neutral quotation marks much of the time (perhaps having MS Word or whatever automatically curl them), French-writing people would be used to having to type "«[...]»", Spanish writers are accustomed to punctuation like "¡[...]!", etc., so the idea of distinct opening and closing marks isn't familiar only to coders.

The difference is that in such cases you use "mirrored" (or reversed) version of opening marks, so it's quite easy to remember them, whereas in BBCode you have to add an extra character (/) to each closing tag and thus it's not as intuitive (for people unfamiliar with programming languages) and easy to remember as the "reversed" characters...

Ok, yeah, I admit the letters are not needed frequently. It might be different if this forum had a "Help with math homework" section.

Even if it did, in many cases those [sup] and [sub] tags would be simply insufficient, as the HTML itself is not sufficient for writing complex mathematical equations and many websites presents them in the form of images (example).

I agree with everything you said about the spoiler tags, and I must admit that the trick that you showed is a pretty clever workaround. 😉 Though I wouldn't mind if they added a dedicated plugin for spoiler tags...

• Even if it did, in many cases those [sup] and [sub] tags would be simply insufficient, as the HTML itself is not sufficient for writing complex mathematical equations and many websites presents them in the form of images (example).

Or they use MathJax.

I agree with everything you said about the spoiler tags, and I must admit that the trick that you showed is a pretty clever workaround. 😉 Though I wouldn't mind if they added a dedicated plugin for spoiler tags

Thanks. Yeah, spoiler tagging might be nice.

BBCode? Is there a standard? No.
As i can see on different forums the syntax for creation of URLs with link text is different and faulty. And if you miss something or dont close a BBCode all gets unreadable. And some BBCode parsers repair to worse BBCode. And typing BBCode by hand is like hell if there is missing a good comment editor.

Markdown is better to remember, but i think Textile can have more, formatting which is missing in BBCode or Markdown.

It doesn't have to be a true standard to be useful, as long as it's kept consistent within a particular forum. As for URL syntax, it's almost always [url]https://example.com[/url] and [url=https://example.com]example[/url]. Generally if you miss something, BBCode parsers will just show the tags and the rest of the text is still essentially readable (unlike, say, actual HTML, where an unclosed tag will swallow up displayed text until the next greater-than character). When broken, it looks like text with something extraneous thrown in, but then so does "[example]example.com)".

I don't recall ever encountering Textile in a forum. Looking through the page you linked, it seems to allow far too much to be used for the untrusted input in a setting like a public forum. Its permitting of raw HTML would obviously need to be disabled, and even its allowance of setting elements' class and style attributes could be abused, unless there is whitelist filtering to allow only certain preset class names or style strings.

• ... And typing BBCode by hand is like hell if there is missing a good comment editor.
...

One nerdy workaround for Linux users is to use xdotool:

bash -c ' sleep 0.5; xdotool getactivewindow  type "<kbd></kbd>"'


I found that in How do I setup keyboard macros? [duplicate] and a comment took it further to move the cursor back to between the two tags.

I'm thinking of making a few scripts for the BBCode tags I use most with, hopefully, easy to remember keyboard shortcuts.

• @aesouza

What's the purpose of the sleep 0.5 delay?

• @aesouza

What's the purpose of the sleep 0.5 delay?

This is what the answer says in that context:

What happens here is that we give user delay of 0.5 seconds to release keyboard shortcut, and then xdotool will type out the key markup tags just as if you were doing it yourself on keyboard.

I tried without the sleep: odd things happened and the intended code didn't appear in the text box!

• dmenu ran (its shortcut on my system is Ctrl+Shift+D)
• Vivaldi's extensions tab opened

• @aesouza

Ah, that makes sense. If it runs before the user has released the modifier keys on the real keyboard, then the virtually-typed keys will accidentally call other keyboard shortcuts (e.g. in your case, <kbd></kbd>" became a rapid-fire Ctrl-Shift-<, Ctrl-Shift-k, Ctrl-Shift-b, Ctrl-Shift-d, etc.). I should have immediately recognized that (particularly since during a job I had a decade ago, I had to use keyboard macros extensively for some mind-numbing data entry, so that's likely a lesson I'd learned and forgotten).

Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.