dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse


Our Discord Notification Server invitation link is https://discord.gg/jB2qmRrxyD

Author Topic: Markdown BBCode Manual  (Read 9 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7285
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 08:54:11 AM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
Markdown BBCode Manual
« on: July 30, 2026, 05:42:54 PM »
Before posting any part of this document to the forum: SMF has no automatic escaping for text that merely looks like BBCode. A literal [md] typed or pasted into a normal post is a real tag-open, not example text — and since it's registered as unparsed_content, everything after it gets swallowed until a matching [/md] (or the rest of the post just disappears into the block). Backticks/code formatting do not protect against this — that's a markdown convention, meaningless to SMF's BBC parser, which runs before markdown rendering ever happens. Wrap any literal [md] / [/md] in ..., or HTML-entity-encode the brackets (`[md]`), before posting.

> Forum BBC policy: all standard BBCode tags are disabled on this forum except  (kept enabled/exempt — it's the escape hatch that makes the warning above possible to follow) and [nobbc][md] itself (the tag this whole document is about). Every other bracket-tag typed in a post is inert, literal text.

Markdown BBCode Mod — Supported Syntax Reference

ElementRaw source (unrendered)Rendered output
Heading (ATX)# H1###### H6<h1>H1</h1><h6>H6</h6>
Heading (Setext)Title\n===== / Title\n-----<h1>Title</h1> / <h2>Title</h2>
Bold**bold** or __bold__<strong>bold</strong>
Italic*italic* or _italic_<em>italic</em>
Bold + italic***both*** or ___both___<strong><em>both</em></strong>
Strikethrough~~struck~~<del>struck</del>
Inline code`code`<code>code</code>
Inline code (contains a backtick) code with inside` ``<code>code with inside</code>`
Fenced code block ``php/ code / ` (also~~~`)<pre class="md-code-block"><code>...</code></pre>
Indented code block4 spaces or a tab before each line (blank lines inside stay part of the same block)<pre class="md-code-block"><code>...</code></pre>
Blockquote> quoted (nested: >> quoted)<blockquote><p>quoted</p></blockquote>
Unordered list (tight)- item / * item / + item<ul><li>item</li></ul>
Unordered list (loose — blank line between items)- one\n\n- two<ul><li><p>one</p></li><li><p>two</p></li></ul>
Ordered list1. item or 1) item<ol><li>item</li></ol>
Ordered list, custom start7. item<ol start="7"><li>item</li></ol>
List marker change starts a new list- foo\n- bar\n+ baztwo separate <ul> elements (different bullet char = different list)
Ordered list can't interrupt a paragraph unless it starts at 1Some text\n14. more textstays one <p>, not a <p> + <ol start="14">
Link[text](url "title")<a href="url" title="title" rel="noopener noreferrer nofollow">text</a>
Link title, alternative delimiters[text](url 'title') or [text](url (title))same as above
Link text with nested brackets[link [foo] bar](url)<a href="url">link [foo] bar</a>
Link, empty URL[text]()<a href="">text</a>
Link, angle-bracket destination (allows spaces)[text](<my file.pdf>)<a href="my%20file.pdf">text</a>
Link destination, balanced parens[text](foo(and(bar)))<a href="foo(and(bar))">text</a>
Link destination, percent-encoding[text](foo b&auml;)<a href="foo%20b%C3%A4">text</a> (HTML entities decoded, then unsafe bytes percent-encoded; existing %XX sequences left alone)
Image![alt](url "title")<img src="url" alt="alt" title="title">
Autolink (angle brackets)<https://example.com> or <user@example.com><a href="https://example.com">https://example.com</a>
Bare URL autolink (GFM ext.)plain https://example.com in running textauto-linked, trailing .,!?: etc. left outside the link
Bare www. autolink (GFM ext.)plain www.example.com in running textlinked with href="http://www.example.com"
Bare email autolink (GFM ext.)plain name@example.com in running text<a href="mailto:name@example.com">name@example.com</a>
Horizontal rule---, ***, or ___ alone on a line<hr>
Hard line breakline ending in two trailing spaces`
`
Paragraph breakblank line between blocksseparate <p> elements
Escaping0not italic1 — any ASCII punctuation character can be escaped this way, not just markdown-syntax ones*not italic* (literal)
GFM table<code>&#124; a &#124; b &#124;

&#124;---&#124;---:&#124; &#124; 1 &#124; 2 &#124;</code> | <table> with align="right" etc. from the :---/---:/:---: header row |

Exclusions & Gaps

Everything the parser doesn't do, grouped by why — because "not spec-complete" covers two very different situations: things we chose not to build, and things security requires us not to build.

Security-motivated exclusions (deliberate — do not "fix" these for conformance)

ExcludedReason
Raw HTML blocks (multi-line embedded HTML in a post)The mod's entire security model is "escape everything on input, then selectively re-decode only what's explicitly recognized as markdown syntax." Parsing raw HTML blocks back into the page means accepting arbitrary user-supplied HTML — exactly the attack surface the last external security review closed (the stored-XSS-via-code-span and control-character URL bypass findings). Re-opening this for GFM conformance would undo that work.
Autolinking arbitrary URI schemes (<irc://...>, <made-up-scheme://...>)isSafeUrl() only allows http, https, ftp, ftps, mailto. CommonMark's actual rule permits any scheme matching [a-zA-Z][a-zA-Z0-9+.-]{1,31}: — a superset that, unfiltered, would also cover javascript:, data:, vbscript:. Broadening the allowlist to add specific safe schemes (irc://, magnet:, etc.) is a legitimate future option, but it's a deliberate allowlist decision to make each time, not something that should get widened automatically in the name of spec coverage.

Scope decisions (no security angle — just low value for a forum)

ExcludedReason
Reference-style links [text][ref] + [ref]: urlAdds a second-pass resolution step for a syntax forum posters essentially never use
FootnotesSame reasoning as reference-style links
Task-list checkboxes - [ ]Low forum-relevance extension

Known remaining gaps (real bugs, still open — no security implication)

  • Angle-bracket link destination spanning a literal line break ([link](<foo\nbar>), which per spec should not be a valid link) currently isn't rejected — a structural side-effect of paragraph line-joining happening at the block level before this inline check can see the newline.
  • Blockquote laziness inside an already-open non-paragraph block (e.g. an unclosed fenced code block within a > quote) isn't tracked precisely — ordinary paragraph laziness is handled correctly.
  • One emphasis test case (__foo, __bar__, baz__) where our output disagrees with the npm commonmark reference package but matches the literal cmark-gfm spec.txt expectation — a documented gray area, not chased further.
« Last Edit: Yesterday at 12:11:04 PM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Tags:
 

Related Topics

  Subject / Started by Replies Last post
0 Replies
15471 Views
Last post October 07, 2015, 06:06:11 AM
by Chip
0 Replies
16206 Views
Last post November 12, 2017, 09:55:39 AM
by Chip
1 Replies
32716 Views
Last post May 31, 2023, 09:56:09 PM
by Chip
0 Replies
19668 Views
Last post June 01, 2023, 05:42:08 AM
by Chip
0 Replies
23414 Views
Last post July 08, 2023, 03:32:25 PM
by Chip
0 Replies
152 Views
Last post July 15, 2026, 07:28:32 PM
by smfadmin


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal