MCPcopy Create free account
hub / github.com/breck7/scroll / interpretTokenStyle

Function interpretTokenStyle

external/.scrollLibs.js:2826–2832  ·  view source on GitHub ↗
(style, options)

Source from the content-addressed store, hash-verified

2824 var styleToClassCache = {},
2825 styleToClassCacheWithMode = {}
2826 function interpretTokenStyle(style, options) {
2827 if (!style || /^\s*$/.test(style)) {
2828 return null
2829 }
2830 var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache
2831 return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&"))
2832 }
2833
2834 // Render the DOM representation of the text of a line. Also builds
2835 // up a 'line map', which points at the DOM nodes that represent

Callers 1

insertLineContentFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected