MCPcopy Create free account
hub / github.com/sql-js/sql.js / extractLineClasses

Function extractLineClasses

GUI/codemirror/lib/codemirror.js:5565–5577  ·  view source on GitHub ↗
(type, output)

Source from the content-addressed store, hash-verified

5563 }
5564
5565 function extractLineClasses(type, output) {
5566 if (type) for (;;) {
5567 var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/);
5568 if (!lineClass) break;
5569 type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);
5570 var prop = lineClass[1] ? "bgClass" : "textClass";
5571 if (output[prop] == null)
5572 output[prop] = lineClass[2];
5573 else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
5574 output[prop] += " " + lineClass[2];
5575 }
5576 return type;
5577 }
5578
5579 function callBlankLine(mode, state) {
5580 if (mode.blankLine) return mode.blankLine(state);

Callers 1

runModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…