mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #5070: epub: Wrong internal href fragment links
This commit is contained in:
parent
f59ebed3bd
commit
93d659568d
1
CHANGES
1
CHANGES
@ -33,6 +33,7 @@ Bugs fixed
|
||||
* #6584: i18n: Error when compiling message catalogs on Hindi
|
||||
* #6708: mathbase: Some deprecated functions have removed
|
||||
* #6709: autodoc: mock object does not work as a class decorator
|
||||
* #5070: epub: Wrong internal href fragment links
|
||||
* #6712: Allow not to install sphinx.testing as runtime (mainly for ALT Linux)
|
||||
|
||||
Testing
|
||||
|
@ -272,7 +272,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
if ':' in node_id:
|
||||
target['ids'][i] = self.fix_fragment('', node_id)
|
||||
|
||||
next_node = target.next_node(siblings=True) # type: Node
|
||||
next_node = target.next_node(ascend=True) # type: Node
|
||||
if isinstance(next_node, nodes.Element):
|
||||
for i, node_id in enumerate(next_node['ids']):
|
||||
if ':' in node_id:
|
||||
|
@ -5,4 +5,9 @@ test-epub-anchor-id
|
||||
|
||||
blah blah blah
|
||||
|
||||
.. setting:: STATICFILES_SECTION
|
||||
|
||||
blah blah blah
|
||||
==============
|
||||
|
||||
see :setting:`STATICFILES_FINDERS`
|
||||
|
@ -321,6 +321,7 @@ def test_epub_anchor_id(app):
|
||||
|
||||
html = (app.outdir / 'index.xhtml').text()
|
||||
assert '<p id="std-setting-STATICFILES_FINDERS">blah blah blah</p>' in html
|
||||
assert '<span id="std-setting-STATICFILES_SECTION"></span><h1>blah blah blah</h1>' in html
|
||||
assert 'see <a class="reference internal" href="#std-setting-STATICFILES_FINDERS">' in html
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user