UNPKG

@awesome-fe/translate

Version:
24 lines 867 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.htmlBlockTokenizer = void 0; function htmlBlockTokenizer(eat, value, silent) { const matches = /^<(code-example|code-examples|code-tabs)\b(.*?)>([\s\S]*?)<\/\1>/s.exec(value) ?? /^( *)<div class=(["']?)filetree\2>.*?\n\1<\/div>/s.exec(value); if (matches) { try { if (silent || !matches) { // either we are not eating (silent) or the match failed return !!matches; } eat(matches[0])({ type: 'htmlRaw', value: matches[0], }); } catch (e) { this.file.fail('Unmatched plain HTML block tag: ' + e.message); } } } exports.htmlBlockTokenizer = htmlBlockTokenizer; //# sourceMappingURL=html-block-tokenizer.js.map