diff options
author | Silvio Tomatis <silviot@gmail.com> | 2016-07-07 12:06:55 +0200 |
---|---|---|
committer | Silvio Tomatis <silviot@gmail.com> | 2016-07-08 15:27:48 +0200 |
commit | 45473b333445d590b35db95982f750c5e30ce671 (patch) | |
tree | bb72d88cb766b89ad345cc20b436ee0f90ee45a1 /sphinx/util/jsdump.py | |
parent | 7db8141238c5d9ce6c93d6f85c8820ed218fd158 (diff) | |
download | sphinx-git-45473b333445d590b35db95982f750c5e30ce671.tar.gz |
Make javascript search work in more contexts
The meaning of `\w` changed from python 2 to python 3.
> $ python3.5 -c "import re; print(re.compile(r'[a-zA-Z]\w*$').match(u'a\xe8'));"
> <_sre.SRE_Match object; span=(0, 2), match='aè'>
> python -c "import re; print(re.compile(r'[a-zA-Z]\w*$').match(u'a\xe8'));"
> None
but the definition of what's an acceptable javascript identifier should not vary from case to case.
Diffstat (limited to 'sphinx/util/jsdump.py')
-rw-r--r-- | sphinx/util/jsdump.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py index fd553bd40..43c2962f1 100644 --- a/sphinx/util/jsdump.py +++ b/sphinx/util/jsdump.py @@ -19,7 +19,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*') -_nameonly_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 ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') |