mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #5097 from tk0miya/5035_qthelp_namespace_allows_dashes
Close #5035: qthelp builder allows dashes in :confval:`qthelp_namespace`
This commit is contained in:
commit
f61593b535
1
CHANGES
1
CHANGES
@ -38,6 +38,7 @@ Incompatible changes
|
||||
* Modifying a template variable ``script_files`` in templates is allowed now.
|
||||
Please use ``app.add_js_file()`` instead.
|
||||
* #5072: Save environment object also with only new documents
|
||||
* #5035: qthelp builder allows dashes in :confval:`qthelp_namespace`
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user