@thoughtsunificator/bbcodeparser v0.3.8
bbcodeparser
bbcodeparser is a JavaScript implementation of the lightweight markup language BBCode.
bbcodeparser is not an HTML Parser. If you wish to convert BBCode to HTML or HTML to BBCode use https://github.com/thoughtsunificator/bbcodeparser-template-example on top of bbcodeparser.
Getting Started
Installing
Browser
Run git submodule add https://github.com/thoughtsunificator/bbcodeparser lib/bbcodeparser
at the root of your project.
Node.js
npm install @thoughtsunificator/bbcodeparser
- Add
type: "module"
to your package.json.
Usage
import { Parser } from '@thoughtsunificator/bbcodeparser' // or ./lib/bbcodeparser/index.js
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].innerText // returns "Hey, thanks!"
API
You can read the API by visiting https://thoughtsunificator.github.io/bbcodeparser.
Try it out!
You can play with bbcodeparser by visiting https://codesandbox.io/s/bbcodeparser-gth53
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago