mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'stable'
This commit is contained in:
commit
e8402bf0ee
1
CHANGES
1
CHANGES
@ -145,6 +145,7 @@ Bugs fixed
|
|||||||
* #4281: Race conditions when creating output directory
|
* #4281: Race conditions when creating output directory
|
||||||
* #4315: For PDF 'howto' documents, ``latex_toplevel_sectioning='part'`` generates
|
* #4315: For PDF 'howto' documents, ``latex_toplevel_sectioning='part'`` generates
|
||||||
``\chapter`` commands
|
``\chapter`` commands
|
||||||
|
* #4214: Two todolist directives break sphinx-1.6.5
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -178,7 +178,8 @@ def process_todo_nodes(app, doctree, fromdocname):
|
|||||||
todo_entry = todo_info['todo']
|
todo_entry = todo_info['todo']
|
||||||
# Remove targetref from the (copied) node to avoid emitting a
|
# Remove targetref from the (copied) node to avoid emitting a
|
||||||
# duplicate label of the original entry when we walk this node.
|
# duplicate label of the original entry when we walk this node.
|
||||||
del todo_entry['targetref']
|
if 'targetref' in todo_entry:
|
||||||
|
del todo_entry['targetref']
|
||||||
|
|
||||||
# (Recursively) resolve references in the todo content
|
# (Recursively) resolve references in the todo content
|
||||||
env.resolve_references(todo_entry, todo_info['docname'],
|
env.resolve_references(todo_entry, todo_info['docname'],
|
||||||
|
@ -346,5 +346,5 @@ class SphinxSmartQuotes(SmartQuotes):
|
|||||||
texttype = {True: 'literal', # "literal" text is not changed:
|
texttype = {True: 'literal', # "literal" text is not changed:
|
||||||
False: 'plain'}
|
False: 'plain'}
|
||||||
for txtnode in txtnodes:
|
for txtnode in txtnodes:
|
||||||
smartquotable = not is_smartquotable(txtnode)
|
notsmartquotable = not is_smartquotable(txtnode)
|
||||||
yield (texttype[smartquotable], txtnode.astext())
|
yield (texttype[notsmartquotable], txtnode.astext())
|
||||||
|
@ -7,3 +7,5 @@ test for sphinx.ext.todo
|
|||||||
bar
|
bar
|
||||||
|
|
||||||
.. todolist::
|
.. todolist::
|
||||||
|
|
||||||
|
.. todolist::
|
||||||
|
@ -87,7 +87,7 @@ def test_todo_not_included(app, status, warning):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx('latex', testroot='ext-todo', freshenv=True,
|
@pytest.mark.sphinx('latex', testroot='ext-todo', freshenv=True,
|
||||||
confoverrides={'todo_include_todos': True, 'todo_emit_warnings': True})
|
confoverrides={'todo_include_todos': True})
|
||||||
def test_todo_valid_link(app, status, warning):
|
def test_todo_valid_link(app, status, warning):
|
||||||
"""
|
"""
|
||||||
Test that the inserted "original entry" links for todo items have a target
|
Test that the inserted "original entry" links for todo items have a target
|
||||||
@ -100,11 +100,13 @@ def test_todo_valid_link(app, status, warning):
|
|||||||
|
|
||||||
content = (app.outdir / 'TodoTests.tex').text()
|
content = (app.outdir / 'TodoTests.tex').text()
|
||||||
|
|
||||||
# Look for the link to foo. We could equally well look for the link to bar.
|
# Look for the link to foo. Note that there are two of them because the
|
||||||
|
# source document uses todolist twice. We could equally well look for links
|
||||||
|
# to bar.
|
||||||
link = r'\{\\hyperref\[\\detokenize\{(.*?foo.*?)}]\{\\sphinxcrossref{' \
|
link = r'\{\\hyperref\[\\detokenize\{(.*?foo.*?)}]\{\\sphinxcrossref{' \
|
||||||
r'\\sphinxstyleemphasis{original entry}}}}'
|
r'\\sphinxstyleemphasis{original entry}}}}'
|
||||||
m = re.findall(link, content)
|
m = re.findall(link, content)
|
||||||
assert len(m) == 1
|
assert len(m) == 2
|
||||||
target = m[0]
|
target = m[0]
|
||||||
|
|
||||||
# Look for the targets of this link.
|
# Look for the targets of this link.
|
||||||
|
Loading…
Reference in New Issue
Block a user