| 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 |