This commit is contained in:
Georg Brandl
2015-03-08 15:38:28 +01:00
14 changed files with 162 additions and 86 deletions

View File

@@ -10,6 +10,8 @@ Contents:
.. toctree::
:maxdepth: 2
:numbered:
:caption: Table of Contents
:name: mastertoc
extapi
images
@@ -54,3 +56,9 @@ This used to crash:
.. toctree::
:hidden:
Test for issue #1700
====================
:ref:`mastertoc`

View File

@@ -141,11 +141,17 @@ Adding \n to test unescaping.
* :ref:`admonition-section`
* :ref:`here <some-label>`
* :ref:`my-figure`
* :ref:`my-figure-name`
* :ref:`my-table`
* :ref:`my-table-name`
* :ref:`my-code-block`
* :ref:`my-code-block-name`
* :numref:`my-figure`
* :numref:`my-figure-name`
* :numref:`my-table`
* :numref:`my-table-name`
* :numref:`my-code-block`
* :numref:`my-code-block-name`
* :doc:`subdir/includes`
* ``:download:`` is tested in includes.txt
* :option:`Python -c option <python -c>`
@@ -172,6 +178,7 @@ Tables
.. _my-table:
.. table:: my table
:name: my-table-name
+----+----------------+----+
| 1 | * Block elems | x |
@@ -199,6 +206,7 @@ Figures
.. _my-figure:
.. figure:: img.png
:name: my-figure-name
My caption of the figure
@@ -237,6 +245,7 @@ Code blocks
.. code-block:: ruby
:linenos:
:caption: my ruby code
:name: my-code-block-name
def ruby?
false

View File

@@ -256,8 +256,8 @@ def test_numref_with_language_ja(app, status, warning):
print(result)
print(status.getvalue())
print(warning.getvalue())
assert '\\renewcommand{\\figurename}{Fig. }\n' in result
assert '\\renewcommand{\\tablename}{Table }\n' in result
assert '\\renewcommand{\\figurename}{Fig. }' in result
assert '\\renewcommand{\\tablename}{Table }' in result
assert '\\floatname{literal-block}{Listing }' in result
assert '\\hyperref[index:fig1]{Fig. \\ref{index:fig1}}' in result
assert '\\hyperref[baz:fig22]{Figure\\ref{baz:fig22}}' in result

View File

@@ -55,7 +55,7 @@ def test_code_block_caption_html(app, status, warning):
html = (app.outdir / 'caption.html').text(encoding='utf-8')
caption = (u'<div class="code-block-caption">'
u'<span class="caption-text">caption <em>test</em> rb'
u'</span><a class="headerlink" href="#id1" '
u'</span><a class="headerlink" href="#caption-test-rb" '
u'title="Permalink to this code">\xb6</a></div>')
assert caption in html
@@ -178,7 +178,7 @@ def test_literalinclude_caption_html(app, status, warning):
html = (app.outdir / 'caption.html').text(encoding='utf-8')
caption = (u'<div class="code-block-caption">'
u'<span class="caption-text">caption <strong>test</strong> py'
u'</span><a class="headerlink" href="#id2" '
u'</span><a class="headerlink" href="#caption-test-py" '
u'title="Permalink to this code">\xb6</a></div>')
assert caption in html

View File

@@ -38,7 +38,7 @@ def check(name, input, idv1output=None, idv2output=None, output=None):
print("Result: ", res)
print("Expected: ", output)
raise DefinitionError("")
ast.describe_signature([], 'lastIsName', None)
ast.describe_signature([], 'lastIsName', None, parentScope=ast.name)
# Artificially set the prefixedName, otherwise the get_id fails.
# It would usually have been set in handle_signarue.
ast.prefixedName = ast.name