From 46aed43c2d39df151ff5fa4747a4edc53b077a73 Mon Sep 17 00:00:00 2001 From: wiemann Date: Wed, 18 May 2005 18:17:33 +0000 Subject: Fixed bug with uppercase image targets. Closing https://sourceforge.net/tracker/index.php?func=detail&aid=1202510&group_id=38414&atid=422030 git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3347 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/docutils/parsers/rst/directives/images.py | 4 ++-- .../test_parsers/test_rst/test_directives/test_images.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docutils/docutils/parsers/rst/directives/images.py b/docutils/docutils/parsers/rst/directives/images.py index c9f793f4b..670f969a0 100644 --- a/docutils/docutils/parsers/rst/directives/images.py +++ b/docutils/docutils/parsers/rst/directives/images.py @@ -14,7 +14,7 @@ __docformat__ = 'reStructuredText' import sys from docutils import nodes, utils from docutils.parsers.rst import directives, states -from docutils.nodes import whitespace_normalize_name +from docutils.nodes import fully_normalize_name from docutils.parsers.rst.roles import set_classes try: @@ -61,7 +61,7 @@ def image(name, arguments, options, content, lineno, reference_node = nodes.reference(refuri=data) elif target_type == 'refname': reference_node = nodes.reference(refname=data, - name=whitespace_normalize_name(options['target'])) + name=fully_normalize_name(options['target'])) state.document.note_refname(reference_node) else: # malformed target messages.append(data) # data is a system message diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_images.py b/docutils/test/test_parsers/test_rst/test_directives/test_images.py index b35cab355..3e0c89344 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_images.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_images.py @@ -357,6 +357,18 @@ u"""\ .. image:: picture.png :align: \xe4 """], +[""" +.. image:: test.png + :target: Uppercase_ + +.. _Uppercase: http://docutils.sourceforge.net/ +""", +"""\ + + + + +"""], ] -- cgit v1.2.1