From 494981be400aa989a32b9d7dbfa5c4329d82c386 Mon Sep 17 00:00:00 2001 From: milde Date: Wed, 12 Sep 2012 07:22:25 +0000 Subject: Fix import of PIL.Image. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7510 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/writers/html4css1/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'docutils/writers') diff --git a/docutils/writers/html4css1/__init__.py b/docutils/writers/html4css1/__init__.py index 2f71d0451..fb60e0861 100644 --- a/docutils/writers/html4css1/__init__.py +++ b/docutils/writers/html4css1/__init__.py @@ -22,7 +22,7 @@ import time import re import urllib try: # check for the Python Imaging Library - import PIL + import PIL.Image except ImportError: try: # sometimes PIL modules are put in PYTHONPATH's root import Image @@ -602,7 +602,13 @@ class HTMLTranslator(nodes.NodeVisitor): '\n\n') def visit_citation_reference(self, node): - href = '#' + node['refid'] + href = '#' + if 'refid' in node: + href += node['refid'] + elif 'refname' in node: + href += self.document.nameids[node['refname']] + # else: # TODO system message (or already in the transform)? + # 'Citation reference missing.' self.body.append(self.starttag( node, 'a', '[', CLASS='citation-reference', href=href)) -- cgit v1.2.1