MCPcopy
hub / github.com/csev/py4e / interpretTokenStyle

Function interpretTokenStyle

tools/pythonauto/static/codemirrorepl/codemirror.js:5647–5652  ·  view source on GitHub ↗
(style, options)

Source from the content-addressed store, hash-verified

5645 // and also looks for line-wide styles.
5646 var styleToClassCache = {}, styleToClassCacheWithMode = {};
5647 function interpretTokenStyle(style, options) {
5648 if (!style || /^\s*$/.test(style)) return null;
5649 var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;
5650 return cache[style] ||
5651 (cache[style] = style.replace(/\S+/g, "cm-$&"));
5652 }
5653
5654 // Render the DOM representation of the text of a line. Also builds
5655 // up a 'line map', which points at the DOM nodes that represent

Callers 1

insertLineContentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected