Without this change, local images with `#` in their name result in incorrect URLs
There is already a similar call to `urllib.parse.quote` for file downloads, suggesting this is a sensible approach.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Takeshi KOMIYA <i.tkomiya@gmail.com>
Since v0.18, docutils has output <aside> tag to represent admonitions.
On the other hand, our custom HTML Writer overrides the handler for
admonition nodes halfly. As a result, the opening and closing tags
become mismatched. This fully overrides the handler to use <div> tag to
represent admonitions.
Removes the need for various translators from raising a
`NotImplementedError` exception when missing support for a specific node
type. docutils will already raise [1][2] a `NotImplementedError`
exception for these cases. This help reduce the implementation inside
Sphinx as well as prevents the possible undesired replication of
unknown-node handling with third-party extensions [3].
In most cases, generating a warning message for an unsupported node type
can be preferred. Providing an indication that a node is not supported
can be easier for a user of Sphinx to understand a limitation of a
builder over a generic "not implemented" exception. This commit takes
the logging call which is already used by `texinfo` and applies it to
the `SphinxTranslator` base class -- which any Sphinx translator
implementation can use.
[1]: https://repo.or.cz/docutils.git/blob/d169015ee0f412cffd69b33654d8a119d99bc0f3:/docutils/nodes.py#l2048
[2]: https://repo.or.cz/docutils.git/blob/53716a13b48128af6045139d3cd2909f61e7ed8e:/docutils/nodes.py#l1897
[3]: https://github.com/sphinx-doc/sphinx/issues/9921
Signed-off-by: James Knight <james.d.knight@live.com>
Properly encode links to files with special characters for the user to
actually be able to download them.
The issue still remains for image files but the logic path
is quite different than with other files fix might involve changes
to docutils.
Fixessphinx-doc/sphinx#3097
Signed-off-by: Johannes Aalto <ext-johannes.aalto@vaisala.com>