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

Function parseText

static/vuejs/vue.js:7637–7663  ·  view source on GitHub ↗
(
  text,
  delimiters
)

Source from the content-addressed store, hash-verified

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

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