diff --git a/CHANGES b/CHANGES index 612d30d5e..933a9f546 100644 --- a/CHANGES +++ b/CHANGES @@ -148,9 +148,16 @@ Documentation * #1757: Fix for usage of :confval:`html_last_updated_fmt`. Thanks to Ralf Hemmecke. -Release 1.3.6 (in development) +Release 1.3.7 (in development) ============================== +Bugs fixed +---------- + + +Release 1.3.6 (released Feb 29, 2016) +===================================== + Features added -------------- @@ -172,7 +179,7 @@ Bugs fixed * #2324: Print a hint how to increase the recursion limit when it is hit. * #1565, #2229: Revert new warning; the new warning will be triggered from version 1.4 on. * #2329: Refresh environment forcely if source directory has changed. - +* #2019: Fix the domain objects in search result are not escaped Release 1.3.5 (released Jan 24, 2016) ===================================== diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index e3f226e19..e9564b0dd 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -203,8 +203,8 @@ html_theme = 'alabaster' # of the sidebar. #html_logo = None -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# The name of an image file (relative to this directory) to use as a favicon of +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py index 75d03f19d..13fb4d528 100644 --- a/sphinx/search/__init__.py +++ b/sphinx/search/__init__.py @@ -16,6 +16,7 @@ from docutils.nodes import raw, comment, title, Text, NodeVisitor, SkipNode from os import path from sphinx.util import jsdump, rpartition +from sphinx.util.pycompat import htmlescape class SearchLanguage(object): @@ -284,6 +285,7 @@ class IndexBuilder(object): continue if prio < 0: continue + fullname = htmlescape(fullname) prefix, name = rpartition(fullname, '.') pdict = rv.setdefault(prefix, {}) try: diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index c8fe76685..dc49691b4 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -441,7 +441,7 @@ class HTMLTranslator(BaseTranslator): def visit_download_reference(self, node): if node.hasattr('filename'): self.body.append( - '' % + '' % posixpath.join(self.builder.dlpath, node['filename'])) self.context.append('') else: diff --git a/tests/test_search.py b/tests/test_search.py index 6b20f14d1..eed6e1e5b 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -13,6 +13,9 @@ from docutils import frontend, utils from docutils.parsers import rst from sphinx.search import IndexBuilder +from sphinx.util import jsdump + +from util import with_app settings = parser = None @@ -39,3 +42,13 @@ def test_wordcollector(): ix.feed('filename', 'title', doc) assert 'boson' not in ix._mapping assert 'fermion' in ix._mapping + + +@with_app() +def test_objects_are_escaped(app, status, warning): + app.builder.build_all() + searchindex = (app.outdir / 'searchindex.js').text() + assert searchindex.startswith('Search.setIndex(') + + index = jsdump.loads(searchindex[16:-2]) + assert 'n::Array<T, d>' in index.get('objects').get('') # n::Array is escaped