mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-17 19:21:20 +03:00
chore(parser): update usage in readme
This commit is contained in:
committed by
GitHub
parent
1cbb9d6dba
commit
79eb220a5b
@@ -3,9 +3,19 @@
|
|||||||
|
|
||||||
Parses BBCode and returns AST Tree looks like
|
Parses BBCode and returns AST Tree looks like
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
`[url=]hello world![/url]`
|
```js
|
||||||
to
|
import parse from '@bbob/parser'
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
onlyAllowTags: ['url', 'h'],
|
||||||
|
onError: (err) => console.warn(err.message, err.lineNumber, err.columnNumber)
|
||||||
|
}
|
||||||
|
const ast = parse('[url=https://github.com/JiLiZART/bbob/tree/master/packages/bbob-parser]hello world![/url]')
|
||||||
|
```
|
||||||
|
|
||||||
|
## Results
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user