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

Function extractLineClasses

static/editor.md/lib/codemirror/lib/codemirror.js:6535–6547  ·  view source on GitHub ↗
(type, output)

Source from the content-addressed store, hash-verified

6533 }
6534
6535 function extractLineClasses(type, output) {
6536 if (type) for (;;) {
6537 var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/);
6538 if (!lineClass) break;
6539 type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);
6540 var prop = lineClass[1] ? "bgClass" : "textClass";
6541 if (output[prop] == null)
6542 output[prop] = lineClass[2];
6543 else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
6544 output[prop] += " " + lineClass[2];
6545 }
6546 return type;
6547 }
6548
6549 function callBlankLine(mode, state) {
6550 if (mode.blankLine) return mode.blankLine(state);

Callers 1

runModeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected