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

Function parseText

static/vuejs/vue.common.js:7643–7669  ·  view source on GitHub ↗
(
  text,
  delimiters
)

Source from the content-addressed store, hash-verified

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

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