diff options
| author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-03-05 21:29:16 +0000 |
|---|---|---|
| committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-03-05 21:29:16 +0000 |
| commit | cfb1f4551b1a6e1dbf9afdf6ed65d1058bc0c8d7 (patch) | |
| tree | 2e09031387cc1214f559c12985e02e63e06fcdf4 | |
| parent | 539eed876ee27f501839644472b072ea26dd39ad (diff) | |
| download | docutils-cfb1f4551b1a6e1dbf9afdf6ed65d1058bc0c8d7.tar.gz | |
made relocated targets before sections zero-length
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
| -rw-r--r-- | docutils/docutils/transforms/references.py | 4 | ||||
| -rw-r--r-- | docutils/test/functional/expected/standalone_rst_html4css1.html | 4 | ||||
| -rwxr-xr-x | docutils/test/test_transforms/test_hyperlinks.py | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/docutils/docutils/transforms/references.py b/docutils/docutils/transforms/references.py index e42183634..5677c5cf8 100644 --- a/docutils/docutils/transforms/references.py +++ b/docutils/docutils/transforms/references.py @@ -42,9 +42,7 @@ class SectionTargets(Transform): if isinstance(n, nodes.section): assert isinstance(n[0], nodes.title) target.parent.remove(target) - target += n[0].get_children() - n[0].clear() - n[0] += target + n[0].insert(0, target) class ChainedTargets(Transform): diff --git a/docutils/test/functional/expected/standalone_rst_html4css1.html b/docutils/test/functional/expected/standalone_rst_html4css1.html index 899b86324..e4a03e6cb 100644 --- a/docutils/test/functional/expected/standalone_rst_html4css1.html +++ b/docutils/test/functional/expected/standalone_rst_html4css1.html @@ -18,8 +18,8 @@ </head> <body> <div class="document" id="restructuredtext-test-document"> -<h1 class="title"><span class="target" id="doctitle">reStructuredText Test Document</span></h1> -<h2 class="subtitle" id="examples-of-syntax-constructs"><span class="target" id="subtitle">Examples of Syntax Constructs</span></h2> +<h1 class="title"><span class="target" id="doctitle"></span>reStructuredText Test Document</h1> +<h2 class="subtitle" id="examples-of-syntax-constructs"><span class="target" id="subtitle"></span>Examples of Syntax Constructs</h2> <table class="docinfo" frame="void" rules="none"> <col class="docinfo-name" /> <col class="docinfo-content" /> diff --git a/docutils/test/test_transforms/test_hyperlinks.py b/docutils/test/test_transforms/test_hyperlinks.py index 2fd9eb831..03f3a0c12 100755 --- a/docutils/test/test_transforms/test_hyperlinks.py +++ b/docutils/test/test_transforms/test_hyperlinks.py @@ -597,7 +597,7 @@ Let's reference it (`explicit target`_) to avoid an irrelevant error. <section id="title" name="title"> <title> <target id="explicit-target" name="explicit target"> - Title + Title <paragraph> Let's reference it ( <reference name="explicit target" refid="explicit-target"> |
