| 1712 | // and also looks for line-wide styles. |
| 1713 | var styleToClassCache = {}, styleToClassCacheWithMode = {}; |
| 1714 | function interpretTokenStyle(style, options) { |
| 1715 | if (!style || /^\s*$/.test(style)) { return null } |
| 1716 | var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; |
| 1717 | return cache[style] || |
| 1718 | (cache[style] = style.replace(/\S+/g, "cm-$&")) |
| 1719 | } |
| 1720 | |
| 1721 | // Render the DOM representation of the text of a line. Also builds |
| 1722 | // up a 'line map', which points at the DOM nodes that represent |