|
From: <mi...@us...> - 2026-06-30 08:11:35
|
Revision: 10377
http://sourceforge.net/p/docutils/code/10377
Author: milde
Date: 2026-06-30 08:11:33 +0000 (Tue, 30 Jun 2026)
Log Message:
-----------
Make section-titles test sample less discombobulating.
The "section_titles.rst" functional test sample tests, among other things,
inline markup (including a reference) in a section title.
Move the sample refeference's target to a place where it makes some sense
instead of causing puzzlement. Adapt the tests using this sample.
Modified Paths:
--------------
trunk/docutils/test/functional/expected/latex_cornercases.tex
trunk/docutils/test/functional/expected/misc_rst_html4css1.html
trunk/docutils/test/functional/expected/misc_rst_html5.html
trunk/docutils/test/functional/input/data/section_titles.rst
Modified: trunk/docutils/test/functional/expected/latex_cornercases.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_cornercases.tex 2026-06-29 14:03:43 UTC (rev 10376)
+++ trunk/docutils/test/functional/expected/latex_cornercases.tex 2026-06-30 08:11:33 UTC (rev 10377)
@@ -227,9 +227,7 @@
Unsupported in ODT.
-\section{Section titles with inline markup%
- \label{references}%
-}
+\section{Section titles with inline markup}
\subsection{\emph{emphasized}, H\textsubscript{2}O, $x^2$, and \hyperref[references]{references}}
@@ -239,6 +237,7 @@
\label{substitutions-fail}%
}
+\phantomsection\label{references}
Note, that the \textquotedbl{}reference name\textquotedbl{} for this section is derived from the
content \emph{before} substitution. You can link to it with the \href{https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html\#hyperlink-references}{phrase
reference} \textquotedbl{}\hyperref[substitutions-fail]{substitutions fail}\textquotedbl{}.
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2026-06-29 14:03:43 UTC (rev 10376)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2026-06-30 08:11:33 UTC (rev 10377)
@@ -50,7 +50,6 @@
</div>
</div>
<div class="section" id="section-titles-with-inline-markup">
-<span id="references"></span>
<h1>Section titles with inline markup</h1>
<div class="section" id="emphasized-h2o-x-2-and-references">
<h2><em>emphasized</em>, H<sub>2</sub>O, <span class="formula"><i>x</i><sup>2</sup></span>, and <a class="reference internal" href="#references">references</a></h2>
@@ -57,7 +56,7 @@
</div>
<div class="section" id="substitutions-fail">
<h2>Substitutions work</h2>
-<p>Note, that the "reference name" for this section is derived from the
+<p id="references">Note, that the "reference name" for this section is derived from the
content <em>before</em> substitution. You can link to it with the <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#hyperlink-references">phrase
reference</a> "<a class="reference internal" href="#substitutions-fail">substitutions fail</a>".
This behaviour may be exploited to get intelligible IDs after <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html#identifier-normalization">identifier
Modified: trunk/docutils/test/functional/expected/misc_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html5.html 2026-06-29 14:03:43 UTC (rev 10376)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2026-06-30 08:11:33 UTC (rev 10377)
@@ -97,8 +97,7 @@
</section>
</section>
<section id="section-titles-with-inline-markup">
-<span id="references"></span>
-<h2><a class="toc-backref" href="#contents" role="doc-backlink">Section titles with inline markup</a><a class="self-link" title="link to this section" href="#references"></a></h2>
+<h2><a class="toc-backref" href="#contents" role="doc-backlink">Section titles with inline markup</a><a class="self-link" title="link to this section" href="#section-titles-with-inline-markup"></a></h2>
<section id="emphasized-h2o-x-2-and-references">
<h3><em>emphasized</em>, H<sub>2</sub>O, <math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
@@ -109,7 +108,7 @@
</section>
<section id="substitutions-fail">
<h3><a class="toc-backref" href="#contents" role="doc-backlink">Substitutions work</a><a class="self-link" title="link to this section" href="#substitutions-fail"></a></h3>
-<p>Note, that the “reference name” for this section is derived from the
+<p id="references">Note, that the “reference name” for this section is derived from the
content <em>before</em> substitution. You can link to it with the <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#hyperlink-references">phrase
reference</a> “<a class="reference internal" href="#substitutions-fail">substitutions fail</a>”.
This behaviour may be exploited to get intelligible IDs after <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html#identifier-normalization">identifier
Modified: trunk/docutils/test/functional/input/data/section_titles.rst
===================================================================
--- trunk/docutils/test/functional/input/data/section_titles.rst 2026-06-29 14:03:43 UTC (rev 10376)
+++ trunk/docutils/test/functional/input/data/section_titles.rst 2026-06-30 08:11:33 UTC (rev 10377)
@@ -34,7 +34,6 @@
<<<<<<<
Unsupported in ODT.
-.. _references:
Section titles with inline markup
==================================
@@ -46,6 +45,8 @@
--------------------
.. |fail| replace:: work
+.. _references:
+
Note, that the "reference name" for this section is derived from the
content *before* substitution. You can link to it with the `phrase
reference`_ "`substitutions fail`_".
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|