From a74a744e3aafa5e8a97fd3338df17822e1e2e439 Mon Sep 17 00:00:00 2001 From: wiemann Date: Tue, 10 Apr 2007 16:35:39 +0000 Subject: added class="internal"/class="external" to a elements git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils/docutils@5045 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- writers/html4css1/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/writers/html4css1/__init__.py b/writers/html4css1/__init__.py index 693672b76..f44f2eaed 100644 --- a/writers/html4css1/__init__.py +++ b/writers/html4css1/__init__.py @@ -1210,17 +1210,19 @@ class HTMLTranslator(nodes.NodeVisitor): raise nodes.SkipNode def visit_reference(self, node): + atts = {'class': 'reference'} if node.has_key('refuri'): - href = node['refuri'] + atts['href'] = node['refuri'] if ( self.settings.cloak_email_addresses - and href.startswith('mailto:')): - href = self.cloak_mailto(href) + and atts['href'].startswith('mailto:')): + atts['href'] = self.cloak_mailto(atts['href']) self.in_mailto = 1 + atts['class'] += ' external' else: assert node.has_key('refid'), \ 'References must have "refuri" or "refid" attribute.' - href = '#' + node['refid'] - atts = {'href': href, 'class': 'reference'} + atts['href'] = '#' + node['refid'] + atts['class'] += ' internal' if not isinstance(node.parent, nodes.TextElement): assert len(node) == 1 and isinstance(node[0], nodes.image) atts['class'] += ' image-reference' -- cgit v1.2.1