Closes #1718. :numref: does not work with capital letters in the label

This commit is contained in:
Takeshi KOMIYA 2015-02-22 11:28:21 +09:00
parent 95d6c68371
commit 62e0490b81
5 changed files with 7 additions and 6 deletions

View File

@ -39,6 +39,7 @@ Bugs fixed
(iPhone5s safari). (iPhone5s safari).
* #1722: restore ``toctree()`` template function behavior that was changed at 1.3b1. * #1722: restore ``toctree()`` template function behavior that was changed at 1.3b1.
* #1732: i18n: localized table caption raises exception. * #1732: i18n: localized table caption raises exception.
* #1718: ``:numref:`` does not work with capital letters in the label
Release 1.3b2 (released Dec 5, 2014) Release 1.3b2 (released Dec 5, 2014)

View File

@ -636,7 +636,7 @@ class StandardDomain(Domain):
return None return None
title = contnode.astext() title = contnode.astext()
if target == title: if target == title.lower():
prefix = env.config.numfig_format.get(figtype, '') prefix = env.config.numfig_format.get(figtype, '')
title = prefix.replace('%s', '#') title = prefix.replace('%s', '#')
newtitle = prefix % '.'.join(map(str, fignumber)) newtitle = prefix % '.'.join(map(str, fignumber))

View File

@ -14,7 +14,7 @@ Baz A
hello,world hello,world
.. _code22: .. _CODE22:
.. code-block:: python .. code-block:: python
:caption: should be List 2.2 :caption: should be List 2.2

View File

@ -29,7 +29,7 @@ test-tocdepth
hello,world hello,world
.. _code_1: .. _CODE_1:
.. code-block:: python .. code-block:: python
:caption: should be List 1 :caption: should be List 1
@ -46,5 +46,5 @@ test-tocdepth
* Fig.2.2 is :numref:`Figure# <fig22>` * Fig.2.2 is :numref:`Figure# <fig22>`
* Table.1 is :numref:`table-1` * Table.1 is :numref:`table-1`
* Table.2.2 is :numref:`Table:# <table22>` * Table.2.2 is :numref:`Table:# <table22>`
* List.1 is :numref:`code_1` * List.1 is :numref:`CODE_1`
* List.2.2 is :numref:`Code-# <code22>` * List.2.2 is :numref:`Code-# <CODE22>`

View File

@ -492,7 +492,7 @@ def test_numfig_disabled(app, status, warning):
(".//li/code/span", '^Figure#$', True), (".//li/code/span", '^Figure#$', True),
(".//li/code/span", '^table-1$', True), (".//li/code/span", '^table-1$', True),
(".//li/code/span", '^Table:#$', True), (".//li/code/span", '^Table:#$', True),
(".//li/code/span", '^code_1$', True), (".//li/code/span", '^CODE_1$', True),
(".//li/code/span", '^Code-#$', True), (".//li/code/span", '^Code-#$', True),
], ],
'foo.html': [ 'foo.html': [