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

Function extractLineClasses

static/mergely/lib/codemirror.js:6740–6752  ·  view source on GitHub ↗
(type, output)

Source from the content-addressed store, hash-verified

6738 }
6739
6740 function extractLineClasses(type, output) {
6741 if (type) for (;;) {
6742 var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/);
6743 if (!lineClass) break;
6744 type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);
6745 var prop = lineClass[1] ? "bgClass" : "textClass";
6746 if (output[prop] == null)
6747 output[prop] = lineClass[2];
6748 else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
6749 output[prop] += " " + lineClass[2];
6750 }
6751 return type;
6752 }
6753
6754 function callBlankLine(mode, state) {
6755 if (mode.blankLine) return mode.blankLine(state);

Callers 1

runModeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected