Discourse BBCode

:discourse2: Summary Discourse BBCode adds the ability to use BBCode to format posts.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-bbcode
:open_book: Install Guide How to install plugins in Discourse

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]

CHANGELOG

TODO

: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

46 Likes

possible to add [hide] , thanks

1 Like

if i enable bbcode plugin, will i be able to use [hide]

I’m afraid [hide] is not a part of this plugin’s features.

@fbpbdmin created this topic that you may find useful:

1 Like

Is there any chance to see the wyswyg button interfaces added for the tags provided by this plugin, where they are not already covered by markdown?

What I mean, the B for bold is fine in using the markdown but there isn’t a markdown for [img][/img] for example and this plugin add support for it but don’t offer a button.

The markdown for an image looks like this:

![Screenshot from 2024-04-01 09-55-37|690x217](upload://oFgNwMN6.png)

And gets inserted if you use the upload/image button in the composer.

1 Like

The markdown for the bbcode [img][/img] is not the same.

It allows to embed an image hosted elsewhere, even when the usual discourse native preview fails.

In any case, it was just an example. I don’t understand why sometimes I have to see this kind of replies that feel passive aggressive without reason to be.

1 Like

Sorry. Maybe I don’t understand your problem. I’ve only used the bbcode plugin to deal with imports that need to support bbcode on imported posts.

You can use the markdown image for external images, so I suspect that it’s not likely that the plugin will get the feature your desire

It should be possible to add the wysiwyg button in a theme component.

As I mentioned, there are features that the markdown already covers, and it should remains like that. It’s absolutely fine that discourse has a “preferred” formatting language and markdown is absolutely fine (I am coming from a developer background, I lost count of the amount of readme.md that I’ve wrote :stuck_out_tongue: )

But most users coming from other forum software, migrating or being introduced to discourse, will find some features missing.

Namely:

  • [u][/u] to underline
  • [center][right][left] to align text
  • [size] to change the of text
  • [font] to change the font face
  • [color=COLOR] to set the colour of text
  • [bgcolor=COLOR] to set the background colour of text
  • [highlight] to highlight text
  • [small] to make text… small
  • [aname=NAME] to create an anchor in a document with a name
  • [jumpto=NAME] to create a link to an anchor
  • [img] create an <img src='something-something.com/image.jpg'> html tag, which is not the same as the upload of an image locally. Lots of self hosted don’t allow the uploading because of disk space concerns. This is another topic I would like to expand upon but it’s not the place here

I can agree that they might be limited use tags, but the fact that there isn’t a visual aid (button or autocomplete when someone type a [) it’s a straight worse user experience for communities and users coming from other major community software, legacy and modern.

I am aware of a plugin (or component, can’t recall) that provided that auto-complete feature but it’s marked broken since quite some time now unfortunately.

2 Likes

I’m such a curmudgeon that I’m quite glad people can’t make posts with underlined, big, or colored text. :person_shrugging:

I think you can insert anchor links, however. and I still don’t think there’s a reason for [img]. here is an off-site image

![here is an off-site image](upload://7Jv6B5bOOwMd4Czf2EDUwsrCihc.jpeg)

But, that’s not helpful, since it doesn’t answer your question. In hopes that I might be a little bit helpful, maybe MD Composer extras could work for you.