MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / interpretTokenStyle

Function interpretTokenStyle

lib/web/CodeMirror/src/line/line_data.js:51–56  ·  view source on GitHub ↗
(style, options)

Source from the content-addressed store, hash-verified

49// and also looks for line-wide styles.
50let styleToClassCache = {}, styleToClassCacheWithMode = {}
51function interpretTokenStyle(style, options) {
52 if (!style || /^\s*$/.test(style)) return null
53 let cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache
54 return cache[style] ||
55 (cache[style] = style.replace(/\S+/g, "cm-$&"))
56}
57
58// Render the DOM representation of the text of a line. Also builds
59// up a 'line map', which points at the DOM nodes that represent

Callers 1

insertLineContentFunction · 0.70

Calls 2

replaceMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected