A Discourse Plugin to support nestable BBCode tags spawning across multiple paragraphs in your posts.
By default, support is provided for the following tags:
[nsfw]: works similarly to the discourse-details plugin
[color=]: lets you color text
[rainbow]: colors text with rainbow colors.
[alpha]: special fonts.
[spoiler]: similar to the discourse-spoiler tag
It also features auto-complete to the composer for these tags.
- fully nestable: you can put colored text inside a hide that is within a spoiler, etc.
- spoiler works on links and color text, you can put a hide inside a spoiler.
- implements a standalone BBCode interpreter outside Discourse’s Markdown pipeline.
At the beginning, I wanted to put the parser into its own separate plugin so that each special tag can be in its own plugin, but my initial attempt at packaging the parser into an es6 module failed:
It’s not impossible though, so that in the future I might split each tag’s functionality into a separate plugin.
[ into the composer, the auto-complete dropdown kicks in to let you choose the tag you want. BBCodes have two modes: block and inline.
block: puts its content in a new
inline: puts the first line of its content within the current the line, and each new line in its own nestable
nsfw have block semantics. The other tags have inline semantics by default, unless a line-break is added after the opening tag.
Tag preview (screenshot)