@awesome-fe/translate
Version:
Translation utils
23 lines • 774 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.plainHtmlTokenizer = void 0;
function plainHtmlTokenizer(eat, value, silent) {
var matches = /^<(code-example|code-tabs)[\s\S]+?<\/\1>/.exec(value);
if (matches) {
try {
if (silent || !matches) {
// either we are not eating (silent) or the match failed
return !!matches;
}
return eat(matches[0])({
type: 'plainHtml',
value: matches[0],
});
}
catch (e) {
this.file.fail('Unmatched plain HTML block tag: ' + e.message);
}
}
}
exports.plainHtmlTokenizer = plainHtmlTokenizer;
//# sourceMappingURL=plain-html-tokenizer.js.map