2
0
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:
Nikolay Kostyurin
2018-07-20 23:36:43 +02:00
committed by GitHub
parent 6c97f04430
commit ade8424ceb
+4 -3
View File
@@ -1,7 +1,8 @@
# @bbob/parser
[![install size](https://packagephobia.now.sh/badge?p=@bbob/parser)](https://packagephobia.now.sh/result?p=@bbob/parser) [![Known Vulnerabilities](https://snyk.io/test/github/JiLiZART/bbob/badge.svg?targetFile=packages%2Fbbob-parser%2Fpackage.json)](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!"]
}