2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-15 11:59:37 +03:00

feat(parse): allow tags to be escaped with backslash (#17)

* feat(parse): allow tags to be escaped with backslash

adds additional option `enableEscapeTags` to `parse` and `createLexer` that
when true will parse openTag and closeTag as WORD (rather than TAG) when
proceeded with backslash
This commit is contained in:
David Ferguson
2019-06-17 20:29:10 +01:00
committed by Nikolay Kostyurin
parent 7e25c45c83
commit c4f78c1230
4 changed files with 46 additions and 2 deletions
+2
View File
@@ -10,6 +10,7 @@ import { createList } from './utils';
* @param {Array<string>} opts.onlyAllowTags
* @param {String} opts.openTag
* @param {String} opts.closeTag
* @param {Boolean} opts.enableEscapeTags
* @return {Array}
*/
const parse = (input, opts = {}) => {
@@ -220,6 +221,7 @@ const parse = (input, opts = {}) => {
onlyAllowTags: options.onlyAllowTags,
openTag: options.openTag,
closeTag: options.closeTag,
enableEscapeTags: options.enableEscapeTags,
});
// eslint-disable-next-line no-unused-vars