Fix #2579: Could not refer a label including both spaces and colons via sphinx.ext.intersphinx

This fixes only the case the label including both spaces and colons as
ad-hoc. There is still a bug if a label having spaces, colons and
numbers like "foo bar:baz 1234".

Note: To support the case, we have to improve the inventory format.
This commit is contained in:
Takeshi KOMIYA 2016-06-24 21:01:35 +09:00
parent fab5911004
commit 211fd352ae
3 changed files with 6 additions and 1 deletions

View File

@ -56,6 +56,8 @@ Bugs fixed
* Failed to build PDF with framed.sty 0.95
* Sphinx now bundles needspace.sty
* #2666: C++, properly look up nested names involving constructors.
* #2579: Could not refer a label including both spaces and colons via
`sphinx.ext.intersphinx`
Release 1.4.3 (released Jun 5, 2016)

View File

@ -106,7 +106,7 @@ def read_inventory_v2(f, uri, join, bufsize=16*1024):
for line in split_lines(read_chunks()):
# be careful to handle names with embedded spaces correctly
m = re.match(r'(?x)(.+?)\s+(\S*:\S*)\s+(\S+)\s+(\S+)\s+(.*)',
m = re.match(r'(?x)(.+?)\s+(\S*:\S*)\s+(-?\d+)\s+(\S+)\s+(.*)',
line.rstrip())
if not m:
continue

View File

@ -43,6 +43,7 @@ module2 py:module 0 foo.html#module-$ -
module1.func py:function 1 sub/foo.html#$ -
CFunc c:function 2 cfunc.html#CFunc -
a term std:term -1 glossary.html#term-a-term -
a term including:colon std:term -1 glossary.html#term-a-term-including-colon -
'''.encode('utf-8'))
@ -78,6 +79,8 @@ def test_read_inventory_v2():
assert invdata1['c:function']['CFunc'][2] == '/util/cfunc.html#CFunc'
assert invdata1['std:term']['a term'][2] == \
'/util/glossary.html#term-a-term'
assert invdata1['std:term']['a term including:colon'][2] == \
'/util/glossary.html#term-a-term-including-colon'
@with_app()