@bbob/parser
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.0.10"></a> | ||
## [1.0.10](https://github.com/JiLiZART/bbob/compare/@bbob/parser@1.0.9...@bbob/parser@1.0.10) (2018-07-11) | ||
### Bug Fixes | ||
* **parser:** tokenizer error with quotemark strings ([7f40050](https://github.com/JiLiZART/bbob/commit/7f40050)) | ||
<a name="1.0.9"></a> | ||
@@ -8,0 +19,0 @@ ## [1.0.9](https://github.com/JiLiZART/bbob/compare/@bbob/parser@1.0.8...@bbob/parser@1.0.9) (2018-07-10) |
@@ -170,5 +170,11 @@ const { | ||
appendNode(lastNestedNode); | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.warn(`Inconsistent tag '${getTokenValue(token)}' on line ${getTokenLine(token)} and column ${getTokenColumn(token)}`); | ||
} else if (options.onError) { | ||
const tag = getTokenValue(token); | ||
const line = getTokenLine(token); | ||
const column = getTokenColumn(token); | ||
options.onError({ | ||
message: `Inconsistent tag '${tag}' on line ${line} and column ${column}`, | ||
lineNumber: line, | ||
columnNumber: column, | ||
}); | ||
} | ||
@@ -232,4 +238,4 @@ } | ||
const parse = (input, opts = {}) => { | ||
options = opts; | ||
tokenizer = createTokenizer(input, parseToken); | ||
options = opts; | ||
@@ -236,0 +242,0 @@ nodes = []; |
@@ -222,3 +222,7 @@ const { | ||
} else if (!this.inTag()) { | ||
this.wordToken[Token.VALUE_ID] += getChar(charCode); | ||
if (!this.wordToken) { | ||
this.wordToken = this.createWordToken(getChar(charCode)); | ||
} else { | ||
this.wordToken[Token.VALUE_ID] += getChar(charCode); | ||
} | ||
} | ||
@@ -225,0 +229,0 @@ |
{ | ||
"name": "@bbob/parser", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Fast, flexible, and lean implementation of BBcode parser", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/JiLiZART/bbob", |
# @bbob/parser | ||
[![install size](https://packagephobia.now.sh/badge?p=@bbob/parser)](https://packagephobia.now.sh/result?p=@bbob/parser) | ||
Parses BBCode and returns AST Tree looks like | ||
`[url=]hello world![/url]` | ||
to | ||
```json | ||
[ | ||
{ | ||
tag: 'url', | ||
attrs: { | ||
url: 'https://github.com/JiLiZART/bbob/tree/master/packages/bbob-parser' | ||
"tag": "url", | ||
"attrs": { | ||
"url": "https://github.com/JiLiZART/bbob/tree/master/packages/bbob-parser" | ||
}, | ||
content: ['hello', ' ', 'world!'] | ||
"content": ["hello", " ", "world!"] | ||
} | ||
] | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20678
680
21