mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#2902: jsdump.loads fails to load search index if keywords starts with underscore
This commit is contained in:
parent
52f4c07202
commit
acd4d9f2ba
2
CHANGES
2
CHANGES
@ -7,6 +7,8 @@ Bugs fixed
|
||||
* #2870: flatten genindex columns' heights.
|
||||
* #2856: Search on generated HTML site doesnt find some symbols
|
||||
* #2882: Fall back to a GET request on 403 status in linkcheck
|
||||
* #2902: jsdump.loads fails to load search index if keywords starts with
|
||||
underscore
|
||||
|
||||
Release 1.4.6 (released Aug 20, 2016)
|
||||
=====================================
|
||||
|
@ -18,7 +18,7 @@ from sphinx.util.pycompat import u
|
||||
|
||||
_str_re = re.compile(r'"(\\\\|\\"|[^"])*"')
|
||||
_int_re = re.compile(r'\d+')
|
||||
_name_re = re.compile(r'[a-zA-Z]\w*')
|
||||
_name_re = re.compile(r'[a-zA-Z_]\w*')
|
||||
_nameonly_re = re.compile(r'[a-zA-Z_][a-zA-Z0-9_]*$')
|
||||
|
||||
# escape \, ", control characters and everything outside ASCII
|
||||
|
@ -14,3 +14,7 @@ def test_jsdump():
|
||||
data = {u'a\xe8': 1}
|
||||
assert dumps(data) == '{"a\\u00e8":1}'
|
||||
assert data == loads(dumps(data))
|
||||
|
||||
data = {'_foo': 1}
|
||||
assert dumps(data) == '{_foo:1}'
|
||||
assert data == loads(dumps(data))
|
||||
|
Loading…
Reference in New Issue
Block a user