mirror of
https://github.com/tenrok/BBob.git
synced 2026-05-15 11:59:37 +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
|
||||
|
||||
## Usage
|
||||
|
||||
`[url=]hello world![/url]`
|
||||
to
|
||||
```js
|
||||
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
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user