mirror of
https://github.com/tenrok/BBob.git
synced 2026-05-15 11:59:37 +03:00
chore(parser): update readme
This commit is contained in:
committed by
GitHub
parent
6c97f04430
commit
ade8424ceb
@@ -1,7 +1,8 @@
|
||||
# @bbob/parser
|
||||
[](https://packagephobia.now.sh/result?p=@bbob/parser) [](https://snyk.io/test/github/JiLiZART/bbob?targetFile=packages%2Fbbob-parser%2Fpackage.json)
|
||||
|
||||
Parses BBCode and returns AST Tree valid for use in [posthtml-render](https://github.com/posthtml/posthtml-render)
|
||||
Parses BBCode and returns AST Tree
|
||||
Valid for use with [posthtml-render](https://github.com/posthtml/posthtml-render)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -12,7 +13,7 @@ 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]', options)
|
||||
const ast = parse('[url=https://github.com]hello world![/url]', options)
|
||||
```
|
||||
|
||||
## Results
|
||||
@@ -22,7 +23,7 @@ const ast = parse('[url=https://github.com/JiLiZART/bbob/tree/master/packages/bb
|
||||
{
|
||||
"tag": "url",
|
||||
"attrs": {
|
||||
"url": "https://github.com/JiLiZART/bbob/tree/master/packages/bbob-parser"
|
||||
"url": "https://github.com"
|
||||
},
|
||||
"content": ["hello", " ", "world!"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user