Permalink
Browse files

Handle BOM (\ufeff) for webelem.javascript_escape.

  • Loading branch information...
The-Compiler committed Nov 25, 2015
1 parent 816d62b commit 73e9fd11188ce4dddd7626e39d691e0df649e87c
Showing with 2 additions and 0 deletions.
  1. +1 −0 qutebrowser/browser/webelem.py
  2. +1 −0 tests/unit/browser/test_webelem.py
@@ -308,6 +308,7 @@ def javascript_escape(text):
('\n', r'\n'), # We also need to escape newlines for some reason.
('\r', r'\r'),
('\x00', r'\x00'),
('\ufeff', r'\ufeff'),
# http://stackoverflow.com/questions/2965293/
('\u2028', r'\u2028'),
('\u2029', r'\u2029'),
@@ -587,6 +587,7 @@ class TestJavascriptEscape:
'': '',
'\x80Ā': '\x80Ā',
'𐀀\x00𐀀\x00': r'𐀀\x00𐀀\x00',
'𐀀\ufeff': r'𐀀\ufeff',
# http://stackoverflow.com/questions/2965293/
'\u2028': r'\u2028',
'\u2029': r'\u2029',

0 comments on commit 73e9fd1

Please sign in to comment.