https://github.com/thoughtsunificator/bbcode-parser
Tiny BBCode JavaScript implementation
https://github.com/thoughtsunificator/bbcode-parser
bbcode bbcode-parser parser
Last synced: about 2 months ago
JSON representation
Tiny BBCode JavaScript implementation
- Host: GitHub
- URL: https://github.com/thoughtsunificator/bbcode-parser
- Owner: thoughtsunificator
- License: mit
- Created: 2021-05-30T20:26:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-07-22T16:33:23.000Z (8 months ago)
- Last Synced: 2026-01-12T19:10:41.665Z (2 months ago)
- Topics: bbcode, bbcode-parser, parser
- Language: JavaScript
- Homepage: http://bbcode-parser.unificator.me
- Size: 972 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bbcode-parser
bbcode-parser is a JavaScript implementation of the lightweight markup language [BBCode](https://en.wikipedia.org/wiki/BBCode).
If you wish to convert BBCode to HTML or HTML to BBCode see [bbcode-parser-template](https://github.com/thoughtsunificator/bbcode-parser-template).
## Getting Started
### Installing
- ``npm install @thoughtsunificator/bbcode-parser``
### Usage
````javascript
import { Parser } from '@thoughtsunificator/bbcode-parser'
const bbDocument = Parser.parse("[b]Hey, thanks![/b]") // return a BBDocument instance
const bbElement bbDocument.documentElement.children[0] // Returns a bbElement
const text = bbDocument.documentElement.children[0].textContent // returns "Hey, thanks!"
````
## API
See [http://bbcode-parser.unificator.me](http://bbcode-parser.unificator.me).
## Try it out!
See [https://codesandbox.io/s/bbcode-parser-gth53](https://codesandbox.io/s/bbcode-parser-gth53).