diff --git a/lib/mixins/canvas-drawer.js b/lib/mixins/canvas-drawer.js index 362e3f2c..a46fddae 100644 --- a/lib/mixins/canvas-drawer.js +++ b/lib/mixins/canvas-drawer.js @@ -610,7 +610,6 @@ function updateTokensLayer (tokensLayer, firstRow, lastRow, offscreenFirstRow, o const emptyLineRegexp = /^\s+$/ const oneOrMoreWhiteSpaceRegexp = /\s+/ -const whiteSpaceRegexp = /\s/ /** * Draws a single token on the given context. @@ -638,7 +637,7 @@ function drawToken (context, text, color, x, y, charWidth, charHeight, ignoreWhi let chars = 0 for (let j = 0, len = text.length; j < len; j++) { const char = text[j] - if (whiteSpaceRegexp.test(char)) { + if (char === ' ') { if (chars > 0) { context.fillRect(x - (chars * charWidth), y, chars * charWidth, charHeight) }