convert-md-to-bbcode
v1.0.0
Published
Convert Markdown to BBCode
Maintainers
Readme
convert-md-to-bbcode 📊
🔨 Convert Markdown to BBCode.
Give a ⭐️ if this project helped you!
Motivation
Markdown became the default format for documentation, but plenty of platforms still do not render it - they accept BBCode instead. If you keep your documents in Markdown (e.g. next to the source files in a repository), publishing them there means converting the same text over and over by hand. This tool does that conversion in one command.
A typical example is TradingView, whose script publication descriptions accept a small set of BBCode tags (documented in the Pine Script docs): [b], [i], [s], [pine], [list], [list=1], [*], [quote], [url=...], [image] - and the core of that set works on any classic BBCode forum.
Preview 🎉

Where BBCode is required 📍
A surprising number of platforms still speak BBCode only:
- ✅ TradingView - script publication descriptions
- ✅ phpBB forums
- ✅ XenForo communities
- ✅ vBulletin and MyBB boards
- ✅ Bitcointalk and most cryptocurrency forums
- ✅ Steam guides, profiles and workshop pages
- ✅ ProBoards and Invision Community sites
[!NOTE] The emitted dialect comes from TradingView, but
[b],[i],[s],[url=...],[list]and[quote]are the common BBCode core, so the output works on classic forums too. The differences are[image](many engines use[img]instead) and[pine](TradingView-only; other engines use[code]).
Features ✨
- 🔄 Converts bold, italic, strikethrough, links and images to their BBCode tags
- ⌨️ Maps inline code to
[b](the dialect has no inline-code tag) - 🧱 Renders headings as plain
[b]lines (BBCode has no headers) - 🎨 Optional
--pinecodersstyle renders##headings as█ [b]SECTION[/b]lines and drops the first H1 (the PineCoders publication convention; the publish form has its own title field,--keep-h1restores it) - 📐 Puts fenced code blocks and tables into
[pine]blocks, so monospace keeps ASCII diagrams and columns aligned - 📋 Preserves list nesting with nested
[list]/[list=1]tags - 🔗 Degrades relative links to plain text (they would point nowhere outside the repository)
- 📦 Zero dependencies
- 📘 Ships TypeScript types and a programmatic API
Usage
Installation:
npm install convert-md-to-bbcodeimport { convertMarkdownToBBCode } from 'convert-md-to-bbcode';
// Faithful conversion: every heading becomes a plain [b] line
const bbcode = convertMarkdownToBBCode('# Title\n\n**Bold** text');
// PineCoders publication style: `█ [b]SECTION[/b]` headings, first H1 dropped
const description = convertMarkdownToBBCode('# Title\n\n**Bold** text', {
style: 'pinecoders',
});CLI
Try it without installing anything:
npx convert-md-to-bbcode docs/indicator.mdOr install globally:
npm install -g convert-md-to-bbcodeconvert-md-to-bbcode docs/indicator.md # BBCode to stdout
convert-md-to-bbcode docs/indicator.md --out desc.txt # write to a file
cat docs/indicator.md | convert-md-to-bbcode # read from stdin
convert-md-to-bbcode docs/indicator.md --pinecoders # PineCoders publication style
convert-md-to-bbcode docs/indicator.md --pinecoders --keep-h1 # ...but keep the top H1Paste-ready: send the result straight to the clipboard and paste it into the publish form:
convert-md-to-bbcode docs/indicator.md | pbcopy # macOS
convert-md-to-bbcode docs/indicator.md | xclip -selection clipboard # Linux (X11)
convert-md-to-bbcode docs/indicator.md | wl-copy # Linux (Wayland)Development 🛠️
npm install
npm test # unit tests
npm run coverage # unit tests with a coverage report
npm run lint # ESLint
npm run format # Prettier over the whole repository🤝 Contributing
Contributions, issues and feature requests are welcome! Feel free to check issues page.
License
The MIT License @ 2026
