Merged in tk0miya/sphinx (pull request #291)

Fix cannot capture title of literal_block node by xref
This commit is contained in:
Takayuki Shimizukawa 2014-09-23 12:21:15 +09:00
commit a820a73442
2 changed files with 9 additions and 0 deletions

View File

@ -562,6 +562,11 @@ class StandardDomain(Domain):
break break
else: else:
continue continue
elif node.tagname == 'literal_block':
if 'caption' in node:
sectname = node['caption']
else:
continue
else: else:
# anonymous-only labels # anonymous-only labels
continue continue

View File

@ -142,6 +142,7 @@ Adding \n to test unescaping.
* :ref:`here <some-label>` * :ref:`here <some-label>`
* :ref:`my-figure` * :ref:`my-figure`
* :ref:`my-table` * :ref:`my-table`
* :ref:`my-code-block`
* :doc:`subdir/includes` * :doc:`subdir/includes`
* ``:download:`` is tested in includes.txt * ``:download:`` is tested in includes.txt
* :option:`Python -c option <python -c>` * :option:`Python -c option <python -c>`
@ -228,8 +229,11 @@ Version markup
Code blocks Code blocks
----------- -----------
.. _my-code-block:
.. code-block:: ruby .. code-block:: ruby
:linenos: :linenos:
:caption: my ruby code
def ruby? def ruby?
false false