diff --git a/src/calibre/gui2/tweak_book/editor/syntax/javascript.py b/src/calibre/gui2/tweak_book/editor/syntax/javascript.py index 45610b49ee..ce177bb0c6 100644 --- a/src/calibre/gui2/tweak_book/editor/syntax/javascript.py +++ b/src/calibre/gui2/tweak_book/editor/syntax/javascript.py @@ -13,6 +13,7 @@ from pygments.token import Comment, Punctuation, Number, Keyword, Text, String, import pygments.unistring as uni from calibre.gui2.tweak_book.editor.syntax.pygments_highlighter import create_highlighter +from polyglot.builtins import native_string_type JS_IDENT_START = ('(?:[$_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + ']|\\\\u[a-fA-F0-9]{4})') @@ -33,39 +34,39 @@ class JavascriptLexer(RegexLexer): flags = re.UNICODE | re.MULTILINE tokens = { - b'commentsandwhitespace': [ + native_string_type('commentsandwhitespace'): [ (r'\s+', Text), (r'