omnilib / sphinx-mdinclude

Markdown extension for Sphinx
https://sphinx-mdinclude.omnilib.dev
MIT License
21 stars 11 forks source link

Render codespans within link text. #68

Closed psobot closed 3 months ago

psobot commented 4 months ago

Before this PR, the following Markdown:

[`foobar`](https://example.com)

...would be rendered in RestructuredText as:

``foobar` <https://example.com>`_

...which unfortunately does not parse and results in the link showing up as plain text in the output HTML.

This PR adds a special case for links whose text starts and ends with backticks, returning raw HTML instead that contains a manually-inserted <a> tag surrounding a <code> block and a <span class="pre">.

amyreese commented 3 months ago

Thank you!