Extendible BBCode Previewer (JavaScript)
You can download the JavaScript module for this
here
.
Input Text:
Remove misaligned tags
Add in line break tags where line breaks exist
Test Cases:
-- Select a Test Case --
Color Faded Text
Nested Color Tags
Nested List Tags
Nested Table Tags
No Parse Tag
Error Case: Misaligned Tags #1 (Produces Error)
Error Case: Misaligned Tags #2 (Produces Error)
Error Case: Mismatched Parent-Child Tags (Produces Error)
Test
Errors: False
Formatting:
[b]bold text[/b]
[code]monospaced text[/code]
[color=red]red text[/color]
[color=#ff0000]red text[/color]
[i]italicized text[/i]
[list][*]1[*]2[/list]
[img]image url[/img]
[noparse][b]bbcode[/b][/noparse]
[quote]quoted text[/quote]
[s]strikethrough text[/s]
[size=30]sized text[/size]
[table][tr][td]cell[/td][/tr][/table]
[u]underlined text[/u]
[url]http://example.com/[/url]
[url=http://example.com/]text[/url]
Output:
patorjk.com