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:
committed by
Nikolay Kostyurin
parent
7e25c45c83
commit
c4f78c1230
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user