Support for basic Markdown

af123

Administrator
Staff member
I've written an initial XenForo Add-on to add basic support for a style of markdown formatting syntax to the forum.
It's a per-user preference which is off by default, and it effectively just replaces some markdown-style tags in your posts with BBCODE before previewing or posting - so it all ends up in the database in BBCODE and if you edit the post later then you'll see the BBCODE.

You can enable it through https://hummy.tv/forum/account/preferences - so far it supports:
``` - for code bocks ` - for inline code __ or ** - for bold _ or * - for italic

Here's an example screenshot with the preview showing.

1522062444275.png
 
Last edited:
Age old convention dating back to teletypes is _underscore_ and /italicise/. Why does this not follow that convention?
 
Proper markdown should be *italic* or _italic_ and **bold** or __bold__ - I've taken a liberty already by just using _
 
Last edited:
Age old convention dating back to teletypes is _underscore_ and /italicise/. Why does this not follow that convention?
I agree, and have already said so somewhere. The's no reason we can't have our own standard markup language, there doesn't seem to be a single set standard. There just might be a bit of a parsing problem when / is used so commonly for other things.
Proper markdown should be *italic* or _italic_ and **bold** or __bold__ - I've taken a liberty already by just using _
Frankly, that's plain silly.
 
The's no reason we can't have our own standard markup language, there doesn't seem to be a single set standard.
We're not going down that road, there may be no RFC for it but the general syntax is well established. The reason I am adding markdown support is because over the past couple of years I've come to use it every day across a large number of platforms (GitHub, Gitter, Jenkins, MatterMost, Reviewboard, Slack to name a few) and when I come here, BBCODE seems clumsy. There's no downside to supporting it now that it's a user preference that defaults to off and it's just a translation layer between the text box and the system. This one might even be worth publishing as a package for other forums to use once it matures a bit.
 
I feel as if a QI Klaxon is going to go off any second for asking this, but, as there are ways of adding bold, italics, code and inline code to posts already, I'm stuggling to see why a user would use this Markdown facilty
 
I feel as if a QI Klaxon is going to go off any second for asking this, but, as there are ways of adding bold, italics, code and inline code to posts already, I'm stuggling to see why a user would use this Markdown facilty
Well it's certainly quicker and if you're used to markdown from other places then it's easier.
 
Ah OK - Thanks
BTW
In your #1 example above you have :-
'Single asterisk bold single asterisk' creating a bold version of the text, shouldn't that require double asterisks or double underscores?
before.jpg
Should be :-

after.jpg
 
Last edited:
How do I make sure markdown is off for me? I fell foul of it today: '"_"' had to be put in plain tags otherwise the post went silly (but mysteriously not this time).
 
How do I make sure markdown is off for me? I fell foul of it today: '"_"' had to be put in plain tags otherwise the post went silly (but mysteriously not this time).
Not sure about the markdown on/off. But the mysterious underscore problem:
Code:
This is test _nothing
This is test _italic_
This is test _nothing
This is test italic
 
How do I make sure markdown is off for me? I fell foul of it today: '"_"' had to be put in plain tags otherwise the post went silly (but mysteriously not this time).
A while ago, Xenforo got native support for markdown so I retired my plugin in favour of that. I don't think there's a per-user option now; at least I can't find it.
 
And I just don't understand what the hell you are all banging on about.
Not done with BB code.
 
Back
Top