MCPcopy Create free account
hub / github.com/TruthHun/BookStack / parseText

Function parseText

static/vuejs/vue.esm.js:7641–7667  ·  view source on GitHub ↗
(
  text,
  delimiters
)

Source from the content-addressed store, hash-verified

7639});
7640
7641function parseText (
7642 text,
7643 delimiters
7644) {
7645 var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
7646 if (!tagRE.test(text)) {
7647 return
7648 }
7649 var tokens = [];
7650 var lastIndex = tagRE.lastIndex = 0;
7651 var match, index;
7652 while ((match = tagRE.exec(text))) {
7653 index = match.index;
7654 // push text token
7655 if (index > lastIndex) {
7656 tokens.push(JSON.stringify(text.slice(lastIndex, index)));
7657 }
7658 // tag token
7659 var exp = parseFilters(match[1].trim());
7660 tokens.push(("_s(" + exp + ")"));
7661 lastIndex = index + match[0].length;
7662 }
7663 if (lastIndex < text.length) {
7664 tokens.push(JSON.stringify(text.slice(lastIndex)));
7665 }
7666 return tokens.join('+')
7667}
7668
7669/* */
7670

Callers 4

parseFunction · 0.70
processAttrsFunction · 0.70
transformNodeFunction · 0.70
transformNode$1Function · 0.70

Calls 1

parseFiltersFunction · 0.70

Tested by

no test coverage detected