MCPcopy Index your code
hub / github.com/csev/py4e / extractLineClasses

Function extractLineClasses

tools/pythonauto/static/codemirrorepl/codemirror.js:5522–5534  ·  view source on GitHub ↗
(type, output)

Source from the content-addressed store, hash-verified

5520 }
5521
5522 function extractLineClasses(type, output) {
5523 if (type) for (;;) {
5524 var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/);
5525 if (!lineClass) break;
5526 type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);
5527 var prop = lineClass[1] ? "bgClass" : "textClass";
5528 if (output[prop] == null)
5529 output[prop] = lineClass[2];
5530 else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
5531 output[prop] += " " + lineClass[2];
5532 }
5533 return type;
5534 }
5535
5536 function callBlankLine(mode, state) {
5537 if (mode.blankLine) return mode.blankLine(state);

Callers 1

runModeFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected