Discourse BBCode

:information_source: Summary Discourse BBCode adds the ability to use BBCode to format posts.
:discourse2: Hosted by us? This plugin is available on our Enterprise plans
:mechanic: Self-host Install Install plugins on a self-hosted site
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-bbcode

Features

The Discourse BBCode plugin pulls in much of the BBCode syntax into Discourse.

Out-of-the-box: Discourse already supports [i], [b], [s], [u], [quote], [url], [email] and [code], this plugin fills in some more of the gaps to provide a more “BBCode” ™ experience.

It supports two types of constructs.

Multiline constructs, which encompass a block. Multiline constructs must never start or end in the middle of a line.

[right]
Like this example
[/right]

Configuration

Inline constructs

Inline constructs that can be embedded in paragraphs [s]like so[/s].

  • [size=SIZE] : set the size of text

  • [font=FACE]: set the font face for text

  • [color=COLOR]: set the [color=#381]color[/color] of text [/li]

  • [bgcolor=COLOR]: set background color of text

  • [highlight]: Highlight text

  • [small]: Make text very small

  • [aname=NAME]: create an anchor in your document with a name

  • [jumpto=NAME]: jump to anchor created with aname

Block level constructs

Lists

[list]
* item
* item
[/list]

or

[ol]
[li]this is a list item[/li]
[/ol]

or

[ul]
[*] this is an item
[*] this is **an** item
[/ul]

Text alignment

[center]
Center some text
[/center]

[right]
Right align some text
[/right]

[left]
Left align some text
[/left]

:warning: Careful with this plugin… It can easily be used for abuse by hiding text and making text unreadable, BBCode will make your markup less understandable

48 Likes

3 posts were split to a new topic: Is [hide] supported in the BBCode plugin?

8 posts were split to a new topic: Add composer buttons for tags added by BBCode plugin(s)

Hey, guys.
I don’t know in which topic it is better to write, but I think this one is suitable) the other one was closed.
I’ve improved one planin a bit.
Sharing it with you for review.

[note]Это обычная заметка[/note]

[info]Это информационная заметка[/info]

[warn]Это предупреждение[/warn]

[negative]Это ошибка[/negative]

[positive]Это успех[/positive]

[caution]Это важное предупреждение[/caution]

dark / light detecting
And administrator settings allowed too.

4 Likes

There is also a theme component for this by the way

4 Likes

Oh, man.
Half a day wasted creating this… And I was looking for a realization… and found nothing worthwhile!
Thank you!

2 Likes

The auth if call outs was mentioning sometime creating a plugin. So maybe the 2 can be made to give a path to TC(client side) and the Plugin (server side)

I believe your plugin will be more friendly with things like print to PDF

Your plugin for example takes consideration for light/dark.

2 Likes

If this plugin can be used for abuse as advised, it would make sense to allow its usage to be restricted by category or by user level. Currently no such ability exists in the plugin.

I could be wrong but I’d say in most cases users hiding text for malicious reasons is a rare occurrence and the warning serves as a caveat of ‘what could happen’.

If this is something that you are worried about you could create a Feature request or use watched words to catch people typing [colour][/color] for example.

1 Like

The watched word idea is a good one.

1 Like