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

Function splitWithDelimiters

static/katex/contrib/auto-render.mjs:96–108  ·  view source on GitHub ↗
(text, delimiters)

Source from the content-addressed store, hash-verified

94/* eslint no-console:0 */
95
96const splitWithDelimiters = function splitWithDelimiters(text, delimiters) {
97 let data = [{
98 type: "text",
99 data: text
100 }];
101
102 for (let i = 0; i < delimiters.length; i++) {
103 const delimiter = delimiters[i];
104 data = splitAtDelimiters(data, delimiter.left, delimiter.right, delimiter.display || false);
105 }
106
107 return data;
108};
109/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
110 * API, we should copy it before mutating.
111 */

Callers 1

renderMathInTextFunction · 0.85

Calls 1

splitAtDelimitersFunction · 0.70

Tested by

no test coverage detected