1.0.10 • Published 6 years ago

@hammad.fauz/parser v1.0.10

Weekly downloads
61
License
MIT
Repository
github
Last release
6 years ago

@hammad.fauz/parser

fork of @bbob/parser

Parses BBCode and returns array AST tree

Valid for use with posthtml-render

Usage

import parse from '@hammad.fauz/parser'

const options = {
    onlyAllowTags: ['url', 'h'],
    onError: (err) => console.warn(err.message, err.lineNumber, err.columnNumber)
}
const ast = parse('[url=https://github.com]hello world![/url]', options)

Results

[
    {
        "tag": "url",
        "attrs": {
            "url": "https://github.com"
        },
        "content": ["hello", " ", "world!"]
    }
]
1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago