[docutils:feature-requests] #94 Should docutils whine about nesting simple body elements?

Günter Milde via Docutils-develop <[email protected]> Wed, 30 Jul 2025 09:17:33 -0000
Newsgroups gmane.text.docutils.devel
Message-ID </p/docutils/feature-requests/94/5724634b70da138993170cdeab9dbf2e40d3c63b.feature-requests@docutils.p.sourceforge.net>
This is a multi-part message in MIME format.
--===============2081890584351185039==
Content-Type: multipart/related; boundary="===============6749415221305641166=="

This is a multi-part message in MIME format.
--===============6749415221305641166==
Content-Type: multipart/alternative; boundary="===============8090007716062519510=="
MIME-Version: 1.0

--===============8090007716062519510==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

- **status**: open-fixed --> closed-fixed
- **Comment**:

The issue is fixed in Docutils 0.22 released 2025-07-29.
Thank you for reporting.




---

**[feature-requests:#94] Should docutils whine about nesting simple body elements?**

**Status:** closed-fixed
**Group:** Default
**Created:** Thu Feb 09, 2023 09:55 AM UTC by Julien Palard
**Last Updated:** Thu Jun 06, 2024 08:16 PM UTC
**Owner:** nobody


Context:

[This](https://github.com/python/cpython/blob/45fa12aec8f508c224a1521cfe3ae597f1026264/Doc/tools/extensions/pyspecific.py#L149) call to `nested_parse` adds a `Paragraph` node to a `Paragraph` node,  this look forbidden by [the doc](https://docutils.sourceforge.io/docs/ref/doctree.html#body-elements), and it also look to misbehave sphinx-side, when translating the document, where we completly loose the nested paragraph once translated.

It renders properly though when **not** translated.

The linked `nested_parse` returns:

```xml
<paragraph classes="availability">
    <pending_xref refdoc="index" refdomain="std" refexplicit="True" reftarget="availability" reftype="ref" refwarn="True">
        <inline classes="xref std std-ref">
            Availability
    : 
    Unix, not Emscripten, not WASI.
    <paragraph>
        Hello world I'm the content of the "availability" directive.
```

If it's really something that should not be done, maybe some kind of warning at build time could help debugging those issues?



---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/docutils/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
--===============8090007716062519510==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><ul>
<li><strong>status</strong>: open-fixed --&gt; closed-fixed</li>
<li><strong>Comment</strong>:</li>
</ul>
<p>The issue is fixed in Docutils 0.22 released 2025-07-29.<br/>
Thank you for reporting.</p>
<hr/>
<p><strong><span><span>[feature-requests:#94]</span></span> Should docutils whine about nesting simple body elements?</strong></p>
<p><strong>Status:</strong> closed-fixed<br/>
<strong>Group:</strong> Default<br/>
<strong>Created:</strong> Thu Feb 09, 2023 09:55 AM UTC by Julien Palard<br/>
<strong>Last Updated:</strong> Thu Jun 06, 2024 08:16 PM UTC<br/>
<strong>Owner:</strong> nobody</p>
<p>Context:</p>
<p><a class="" href="https://github.com/python/cpython/blob/45fa12aec8f508c224a1521cfe3ae597f1026264/Doc/tools/extensions/pyspecific.py#L149" rel="nofollow">This</a> call to <code>nested_parse</code> adds a <code>Paragraph</code> node to a <code>Paragraph</code> node,  this look forbidden by <a class="" href="https://docutils.sourceforge.io/docs/ref/doctree.html#body-elements" rel="nofollow">the doc</a>, and it also look to misbehave sphinx-side, when translating the document, where we completly loose the nested paragraph once translated.</p>
<p>It renders properly though when <strong>not</strong> translated.</p>
<p>The linked <code>nested_parse</code> returns:</p>
<div class="codehilite"><pre><span></span><code><span class="nt">&lt;paragraph</span><span class="w"> </span><span class="na">classes=</span><span class="s">"availability"</span><span class="nt">&gt;</span>
<span class="w">    </span><span class="nt">&lt;pending_xref</span><span class="w"> </span><span class="na">refdoc=</span><span class="s">"index"</span><span class="w"> </span><span class="na">refdomain=</span><span class="s">"std"</span><span class="w"> </span><span class="na">refexplicit=</span><span class="s">"True"</span><span class="w"> </span><span class="na">reftarget=</span><span class="s">"availability"</span><span class="w"> </span><span class="na">reftype=</span><span class="s">"ref"</span><span class="w"> </span><span class="na">refwarn=</span><span class="s">"True"</span><span class="nt">&gt;</span>
<span class="w">        </span><span class="nt">&lt;inline</span><span class="w"> </span><span class="na">classes=</span><span class="s">"xref std std-ref"</span><span class="nt">&gt;</span>
<span class="w">            </span>Availability
<span class="w">    </span>:<span class="w"> </span>
<span class="w">    </span>Unix,<span class="w"> </span>not<span class="w"> </span>Emscripten,<span class="w"> </span>not<span class="w"> </span>WASI.
<span class="w">    </span><span class="nt">&lt;paragraph&gt;</span>
<span class="w">        </span>Hello<span class="w"> </span>world<span class="w"> </span>I'm<span class="w"> </span>the<span class="w"> </span>content<span class="w"> </span>of<span class="w"> </span>the<span class="w"> </span>"availability"<span class="w"> </span>directive.
</code></pre></div>

<p>If it's really something that should not be done, maybe some kind of warning at build time could help debugging those issues?</p>
<hr/>
<p>Sent from sourceforge.net because [email protected] is subscribed to <a href="https://sourceforge.net/p/docutils/feature-requests/">https://sourceforge.net/p/docutils/feature-requests/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/docutils/admin/feature-requests/options.">https://sourceforge.net/p/docutils/admin/feature-requests/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>
--===============8090007716062519510==--

--===============6749415221305641166==--


--===============2081890584351185039==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============2081890584351185039==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline