diff --git a/CHANGES b/CHANGES index 65ad40b9f..75d8c6725 100644 --- a/CHANGES +++ b/CHANGES @@ -39,6 +39,7 @@ Bugs fixed (iPhone5s safari). * #1722: restore ``toctree()`` template function behavior that was changed at 1.3b1. * #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) diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index d39762fad..c02c9827a 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -636,7 +636,7 @@ class StandardDomain(Domain): return None title = contnode.astext() - if target == title: + if target == title.lower(): prefix = env.config.numfig_format.get(figtype, '') title = prefix.replace('%s', '#') newtitle = prefix % '.'.join(map(str, fignumber)) diff --git a/tests/roots/test-numfig/baz.rst b/tests/roots/test-numfig/baz.rst index da9e0fe0a..42fcb06d1 100644 --- a/tests/roots/test-numfig/baz.rst +++ b/tests/roots/test-numfig/baz.rst @@ -14,7 +14,7 @@ Baz A hello,world -.. _code22: +.. _CODE22: .. code-block:: python :caption: should be List 2.2 diff --git a/tests/roots/test-numfig/index.rst b/tests/roots/test-numfig/index.rst index 7779fe91c..a2826a1e4 100644 --- a/tests/roots/test-numfig/index.rst +++ b/tests/roots/test-numfig/index.rst @@ -29,7 +29,7 @@ test-tocdepth hello,world -.. _code_1: +.. _CODE_1: .. code-block:: python :caption: should be List 1 @@ -46,5 +46,5 @@ test-tocdepth * Fig.2.2 is :numref:`Figure# ` * Table.1 is :numref:`table-1` * Table.2.2 is :numref:`Table:# ` -* List.1 is :numref:`code_1` -* List.2.2 is :numref:`Code-# ` +* List.1 is :numref:`CODE_1` +* List.2.2 is :numref:`Code-# ` diff --git a/tests/test_build_html.py b/tests/test_build_html.py index bc99ab3b8..978bee8ed 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -492,7 +492,7 @@ def test_numfig_disabled(app, status, warning): (".//li/code/span", '^Figure#$', True), (".//li/code/span", '^table-1$', True), (".//li/code/span", '^Table:#$', True), - (".//li/code/span", '^code_1$', True), + (".//li/code/span", '^CODE_1$', True), (".//li/code/span", '^Code-#$', True), ], 'foo.html': [