summaryrefslogtreecommitdiff
path: root/docutils
diff options
context:
space:
mode:
authorwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-02-27 00:06:51 +0000
committerwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-02-27 00:06:51 +0000
commit2c04ed7cf051fbb7c565b051a27a3d30a4b3a38b (patch)
tree7ee84129fc13d30e21879ef1853c0fe844c4b108 /docutils
parent8dd948474a903896171572faf3a8efa6f76edcdb (diff)
downloaddocutils-2c04ed7cf051fbb7c565b051a27a3d30a4b3a38b.tar.gz
use "span" instead of "a" tags for targets,
because otherwise we get invalid XHTML due to nested "a" elements git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@2995 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
-rw-r--r--docutils/HISTORY.txt2
-rw-r--r--docutils/docutils/writers/html4css1.py4
-rw-r--r--docutils/test/functional/expected/standalone_rst_html4css1.html8
3 files changed, 8 insertions, 6 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt
index 0ab1fbb70..3d75e3555 100644
--- a/docutils/HISTORY.txt
+++ b/docutils/HISTORY.txt
@@ -51,6 +51,8 @@ Changes Since 0.3.7
- Fixed unencoded stylesheet reference bug (characters like "&" in
stylesheet reference).
+ - ``target`` nodes now appear as ``span`` tags (instead of ``a``
+ tags).
* docutils/writers/latex2e.py:
diff --git a/docutils/docutils/writers/html4css1.py b/docutils/docutils/writers/html4css1.py
index 148790b58..cd28ffa15 100644
--- a/docutils/docutils/writers/html4css1.py
+++ b/docutils/docutils/writers/html4css1.py
@@ -1202,8 +1202,8 @@ class HTMLTranslator(nodes.NodeVisitor):
def visit_target(self, node):
if not (node.has_key('refuri') or node.has_key('refid')
or node.has_key('refname')):
- self.body.append(self.starttag(node, 'a', '', CLASS='target'))
- self.context.append('</a>')
+ self.body.append(self.starttag(node, 'span', '', CLASS='target'))
+ self.context.append('</span>')
else:
self.context.append('')
diff --git a/docutils/test/functional/expected/standalone_rst_html4css1.html b/docutils/test/functional/expected/standalone_rst_html4css1.html
index bc1cb3561..b4e932b8d 100644
--- a/docutils/test/functional/expected/standalone_rst_html4css1.html
+++ b/docutils/test/functional/expected/standalone_rst_html4css1.html
@@ -163,8 +163,8 @@ cross-references (<a class="reference" href="#example">example</a>), external hy
(<a class="reference" href="http://www.python.org">Python web site</a>), footnote references
(manually numbered <a class="footnote-reference" href="#id6" id="id1" name="id1">[1]</a>, anonymous auto-numbered <a class="footnote-reference" href="#id9" id="id2" name="id2">[3]</a>, labeled
auto-numbered <a class="footnote-reference" href="#label" id="id3" name="id3">[2]</a>, or symbolic <a class="footnote-reference" href="#id10" id="id4" name="id4">[*]</a>), citation references
-(<a class="citation-reference" href="#cit2002" id="id5" name="id5">[CIT2002]</a>), substitution references (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />), and <a class="target" id="inline-hyperlink-targets" name="inline-hyperlink-targets">inline
-hyperlink targets</a> (see <a class="reference" href="#targets">Targets</a> below for a reference back to here).
+(<a class="citation-reference" href="#cit2002" id="id5" name="id5">[CIT2002]</a>), substitution references (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />), and <span class="target" id="inline-hyperlink-targets">inline
+hyperlink targets</span> (see <a class="reference" href="#targets">Targets</a> below for a reference back to here).
Character-level inline markup is also possible (although exceedingly
ugly!) in <em>re</em><tt class="docutils literal"><span class="pre">Structured</span></tt><em>Text</em>. Problems are indicated by
<a href="#id19" name="id20"><span class="problematic" id="id20">|problematic|</span></a> text (generated by processing errors; this one is
@@ -211,7 +211,7 @@ live link to PEP 258 here.</p>
</ul>
</div>
<div class="section" id="enumerated-lists">
-<h2><a class="toc-backref" href="#id33" name="enumerated-lists">2.3&nbsp;&nbsp;&nbsp;<a class="target" id="target" name="target"></a>Enumerated Lists</a></h2>
+<h2><a class="toc-backref" href="#id33" name="enumerated-lists">2.3&nbsp;&nbsp;&nbsp;<span class="target" id="target"></span>Enumerated Lists</a></h2>
<ol class="arabic">
<li><p class="first">Arabic numerals.</p>
<ol class="loweralpha simple">
@@ -490,7 +490,7 @@ citation.</p>
</div>
<div class="section" id="targets">
<h2><a class="toc-backref" href="#id43" name="targets">2.13&nbsp;&nbsp;&nbsp;Targets</a></h2>
-<p><a class="target" id="example" name="example"></a>This paragraph is pointed to by the explicit &quot;example&quot; target. A
+<p><span class="target" id="example"></span>This paragraph is pointed to by the explicit &quot;example&quot; target. A
reference can be found under <a class="reference" href="#inline-markup">Inline Markup</a>, above. <a class="reference" href="#inline-hyperlink-targets">Inline
hyperlink targets</a> are also possible.</p>
<p>Section headers are implicit targets, referred to by name. See