summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-06-16 18:33:09 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-06-16 18:33:09 +0900
commitfa3e0ca6827c12999e09d18593abcc98fb5ecca2 (patch)
treeb8967d3bc6095f8a46bf4301487819821a591cf3
parent71c0eb6b1ac07779bfe801469f50d41f5852131e (diff)
downloadsphinx-git-fa3e0ca6827c12999e09d18593abcc98fb5ecca2.tar.gz
Close #5035: qthelp builder allows dashes in :confval:`qthelp_namespace`
-rw-r--r--CHANGES1
-rw-r--r--sphinx/builders/qthelp.py2
-rw-r--r--tests/test_build_qthelp.py6
3 files changed, 5 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 2c4374abe..1bf3f113c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -37,6 +37,7 @@ Incompatible changes
* #4983: html: The URL for the productionlist has been changed
* Modifying a template variable ``script_files`` in templates is allowed now.
Please use ``app.add_js_file()`` instead.
+* #5035: qthelp builder allows dashes in :confval:`qthelp_namespace`
Deprecated
----------
diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py
index 9afe47637..a40cb2709 100644
--- a/sphinx/builders/qthelp.py
+++ b/sphinx/builders/qthelp.py
@@ -140,7 +140,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
else:
nspace = 'org.sphinx.%s.%s' % (outname, self.config.version)
- nspace = re.sub('[^a-zA-Z0-9.]', '', nspace)
+ nspace = re.sub('[^a-zA-Z0-9.\-]', '', nspace)
nspace = re.sub(r'\.+', '.', nspace).strip('.')
nspace = nspace.lower()
diff --git a/tests/test_build_qthelp.py b/tests/test_build_qthelp.py
index a0d4fcf2a..f427ec2d8 100644
--- a/tests/test_build_qthelp.py
+++ b/tests/test_build_qthelp.py
@@ -88,11 +88,11 @@ def test_qthelp_namespace(app, status, warning):
app.builder.build_all()
qhp = (app.outdir / 'Python.qhp').text()
- assert '<namespace>org.sphinxdoc.sphinx</namespace>' in qhp
+ assert '<namespace>org.sphinx-doc.sphinx</namespace>' in qhp
qhcp = (app.outdir / 'Python.qhcp').text()
- assert '<homePage>qthelp://org.sphinxdoc.sphinx/doc/index.html</homePage>' in qhcp
- assert '<startPage>qthelp://org.sphinxdoc.sphinx/doc/index.html</startPage>' in qhcp
+ assert '<homePage>qthelp://org.sphinx-doc.sphinx/doc/index.html</homePage>' in qhcp
+ assert '<startPage>qthelp://org.sphinx-doc.sphinx/doc/index.html</startPage>' in qhcp
@pytest.mark.sphinx('qthelp', testroot='basic')