Skip to content

Commit

Permalink
Merge pull request sphinx-doc#5063 from jakobandersen/search_use_disp…
Browse files Browse the repository at this point in the history
…name

Search: make a difference between fullname and dispname
  • Loading branch information
tk0miya authored Aug 20, 2018
2 parents e3f383a + dd711a7 commit db8865a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sphinx/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ def get_objects(self, fn2index):
for domainname, domain in sorted(iteritems(self.env.domains)):
for fullname, dispname, type, docname, anchor, prio in \
sorted(domain.get_objects()):
# XXX use dispname?
if docname not in fn2index:
continue
if prio < 0:
continue
fullname = htmlescape(fullname)
prefix, name = rpartition(fullname, '.')
dispname = htmlescape(dispname)
prefix, name = rpartition(dispname, '.')
pdict = rv.setdefault(prefix, {})
try:
typeindex = otypes[domainname, type]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_IndexBuilder():
'docnames': ('docname', 'docname2'),
'envversion': '1.0',
'filenames': ['filename', 'filename2'],
'objects': {'': {'objname': (0, 0, 1, '#anchor')}},
'objects': {'': {'objdispname': (0, 0, 1, '#anchor')}},
'objnames': {0: ('dummy', 'objtype', 'objtype')},
'objtypes': {0: 'dummy:objtype'},
'terms': {'comment': [0, 1],
Expand Down

0 comments on commit db8865a

Please sign in to comment.