Since 0.18, Element.traverse() returns an iterator instead of
intermediate object. As a result, the return value is always considered
as truthy value. And it becomes fragile when the caller modifies the
doctree on the loop.
Summary:
My project was mysteriously dropping warnings (see https://github.com/sphinx-doc/sphinx/issues/9733 for detailed repro) and I realized that it's becaues it imports libraries like airflow or mlflow that set up loggers automatically when they are imported. This causes this handler to flush even though shouldFlush is set to always return False. A simple workaround is to override flush to be a no-op.
Test Plan: Repeat repro steps from #9733 - project now always includes warnings
Parameters are written in HTML as (leaving out some internal classes):
```
<strong>name</strong><span class="classifier"><a><code><span>TypeName</span></code></a></span>
```
but in rendered form there's a colon between the name and type. This
colon is inserted virtually using CSS, but since it doesn't exist, the
browser thinks both sides are part of the same word.
Styling the virtual text as inline block makes it be treated as a break,
but also makes it apply vertical margins, so we need to set those to
zero again.
See https://github.com/matplotlib/matplotlib/issues/21432
Since 0.18, `meta` directive inserts meta node into the top of the
document. It confuses MetadataCollector.
This allows doctree contains PreBibliographic nodes just before docinfo
node.
Whilst working on the Reproducible Builds effort [0] I noticed that sphinx
generates output that is not reproducible, causing a number of packages in
Debian to unreproducible.
Specifically, when Sphinx locates an alias of an instance when generating
'autodoc' documentation, it uses the raw Python repr(...) of the object and
does not sanitise it for memory addresses (etc.) like elsewhere in Sphinx.
This can result in documentation like this:
-<dd><p>alias of <webob.client.SendRequest object at 0x7fd769189df0></p>
+<dd><p>alias of <webob.client.SendRequest object at 0x7f0f02233df0></p>
Patch attached that uses the object_description method, which was added to fix
precisely this kind of issue.
I originally filed this in Debian as bug #996948 [1].
[0] https://reproducible-builds.org/
[1] https://bugs.debian.org/996948
Sphinx version 4.0 introduced a bug in handling hlists in its LaTeX backend.
Due to improper backslash escaping,
LaTeX "\raggedright" command gets written as
Carriage Return character (0x0D) followed by "aggedright".
This results in stray "aggedright" text appearing in the resulting PDF
and lack of effect \raggedright was supposed to achieve.
Fix this by converting the remaining string to a raw string.
This appears to be the only occurrence of such a missing escaping
based on a quick grep.
Fixes#9734.
Fixes: 20884bb0c9: "refactor: LaTeX: Use raw strings for LaTeX macros"
Since docutils-0.18, auto_id_prefix setting will be changed to `'%'`
from `'id'`. To keep backward compatibility of node IDs, this sets
`'id'` to settings explicitly.