summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-02-26 16:01:22 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-02-26 16:01:22 +0900
commit496ff70f4aeb1a60dc0f283d9a3d4d8451c4f7fe (patch)
tree6291cb017b64f4a3fc124557dccfa39063f1e5c3
parent3a67910cf41d33e311c47a0b363494734acf5040 (diff)
parent5fc40108d94d7598c2ff09fb00ba781967ef70a4 (diff)
downloadsphinx-git-496ff70f4aeb1a60dc0f283d9a3d4d8451c4f7fe.tar.gz
Merge branch 'stable'
-rw-r--r--CHANGES19
-rw-r--r--sphinx/make_mode.py22
-rw-r--r--sphinx/writers/html.py8
-rw-r--r--tests/roots/test-html_entity/conf.py5
-rw-r--r--tests/roots/test-html_entity/index.rst31
-rw-r--r--tests/test_build_html.py9
6 files changed, 71 insertions, 23 deletions
diff --git a/CHANGES b/CHANGES
index fa14e09fa..75b84115a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
Release 1.6 (in development)
============================
@@ -95,7 +96,7 @@ Deprecated
patch them. In particular the ``\makesavenoteenv`` macro is not in use anymore
and its definition will be removed at Sphinx 1.7.
-Release 1.5.3 (in development)
+Release 1.5.4 (in development)
==============================
Incompatible changes
@@ -107,10 +108,23 @@ Deprecated
Features added
--------------
+Bugs fixed
+----------
+
+Testing
+--------
+
+Release 1.5.3 (released Feb 26, 2017)
+=====================================
+
+Features added
+--------------
+
* Support requests-2.0.0 (experimental) (refs: #3367)
* (latex) PDF page margin dimensions may be customized (refs: #3387)
* ``literalinclude`` directive allows combination of ``:pyobject:`` and
``:lines:`` options (refs: #3416)
+* #3400: make-mode doesn't use subprocess on building docs
Bugs fixed
----------
@@ -134,9 +148,6 @@ Bugs fixed
* #3418: Search button is misaligned in nature and pyramid theme
* #3421: Could not translate a caption of tables
-Testing
---------
-
Release 1.5.2 (released Jan 22, 2017)
=====================================
diff --git a/sphinx/make_mode.py b/sphinx/make_mode.py
index 346f9db2d..4f55d71aa 100644
--- a/sphinx/make_mode.py
+++ b/sphinx/make_mode.py
@@ -19,9 +19,9 @@ from __future__ import print_function
import os
import sys
from os import path
-from subprocess import call
import sphinx
+from sphinx import cmdline
from sphinx.util.console import bold, blue # type: ignore
from sphinx.util.osutil import cd, rmtree
@@ -277,20 +277,12 @@ class Make(object):
if doctreedir is None:
doctreedir = self.builddir_join('doctrees')
- orig_cmd = sys.argv[0]
- if sys.platform == 'win32' and orig_cmd.endswith('.exe'):
- # win32: 'sphinx-build.exe'
- cmd = [orig_cmd]
- elif sys.platform == 'win32' and os.path.splitext(orig_cmd)[1] == '':
- # win32: 'sphinx-build' without extension
- cmd = [orig_cmd + '.exe']
- else:
- # win32: 'sphinx-build.py'
- # linux, mac: 'sphinx-build' or 'sphinx-build.py'
- cmd = [sys.executable, orig_cmd]
-
- return call(cmd + ['-b', builder] + opts + # type: ignore
- ['-d', doctreedir, self.srcdir, self.builddir_join(builder)]) # type: ignore # NOQA
+ args = [sys.argv[0],
+ '-b', builder,
+ '-d', doctreedir,
+ self.srcdir,
+ self.builddir_join(builder)]
+ return cmdline.main(args + opts)
def run_make_mode(args):
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
index 7e924fce9..dba495433 100644
--- a/sphinx/writers/html.py
+++ b/sphinx/writers/html.py
@@ -681,6 +681,10 @@ class HTMLTranslator(BaseTranslator):
# type: (nodes.Node) -> None
self.body.append('</td>')
+ def visit_option_group(self, node):
+ BaseTranslator.visit_option_group(self, node)
+ self.context[-2] = self.context[-2].replace('&nbsp;', '&#160;')
+
def bulk_text_processor(self, text):
# type: (unicode) -> unicode
return text
@@ -957,10 +961,6 @@ class SmartyPantsHTMLTranslator(HTMLTranslator):
self.no_smarty -= 1
HTMLTranslator.depart_option(self, node)
- def visit_option_group(self, node):
- HTMLTranslator.visit_option_group(self, node)
- self.context[-2] = self.context[-2].replace('&nbsp;', '&#160;')
-
def bulk_text_processor(self, text):
# type: (unicode) -> unicode
if self.no_smarty <= 0:
diff --git a/tests/roots/test-html_entity/conf.py b/tests/roots/test-html_entity/conf.py
new file mode 100644
index 000000000..c46e40773
--- /dev/null
+++ b/tests/roots/test-html_entity/conf.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+
+master_doc = 'index'
+html_theme = 'classic'
+exclude_patterns = ['_build']
diff --git a/tests/roots/test-html_entity/index.rst b/tests/roots/test-html_entity/index.rst
new file mode 100644
index 000000000..e4cbd99c3
--- /dev/null
+++ b/tests/roots/test-html_entity/index.rst
@@ -0,0 +1,31 @@
+.. _index:
+
+test-html_entity (#3450)
+=========================
+
+Empty cell
+----------
+
+.. list-table::
+ :header-rows: 1
+ - * un
+ *
+ * trois
+
+Return description in function signature
+----------------------------------------
+
+.. py:function:: test() -> string
+
+ rarr
+
+Field list that has long name (over 14 characters)
+--------------------------------------------------
+
+:abcdefghijklmnopqrstuvwxyz: fieldlist
+
+Option list that has long name (over 14 characters)
+---------------------------------------------------
+
+-a all
+-b long_long_file use file
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index 34c257adf..e398afc86 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -1140,3 +1140,12 @@ def test_html_sourcelink_suffix(app):
assert '<a href="_sources/images.txt"' in content_images
assert (app.outdir / '_sources' / 'otherext.foo').exists()
assert (app.outdir / '_sources' / 'images.txt').exists()
+
+
+@pytest.mark.sphinx('html', testroot='html_entity')
+def test_html_entity(app):
+ app.builder.build_all()
+ valid_entities = {'amp', 'lt', 'gt', 'quot', 'apos'}
+ content = (app.outdir / 'index.html').text()
+ for entity in re.findall(r'&([a-z]+);', content, re.M):
+ assert entity not in valid_entities