Update sphinx_mdinclude to work with mistune v3.0.2.
Fixes: #22
Detailed description of PR
example.md: Fix two issues: there was a missing space after a close HTML delimiter, and the auto link was just plain text.
pyproject.toml: Update the mistune dependency version numbers.
sphinx_mdinclude/parse.py: quite significant reworking to update to mistune 3.0.2 internals.
sphinx_mdinclude/render.py: likewise. The new render_token function is a bit grim, unfortunately. There's probably a nicer way to do it, but this works. I have also fixed a small bug: in codespan(), if the inline code begins or ends with a space or backquote, then it cannot be rendered using double backquotes (and this broke the inclusion of changelog.md in the documentation).
sphinx_mdinclude/tests/__init__.py: I've renamed TestConplexText as TestComplexTest.
sphinx_mdinclude/tests/test.rst: I have modified this to match the output of convert(testmd), where testmd is the content of the test.md file.
sphinx_mdinclude/tests/test_renderer.py: four extra tests for inline code beginning/ending with spaces or quotes. Rename TestConplexText. In the new mistune, footnote references are all normalised to upper-case; update the expected output in TestFootNote to this new behaviour.
Description
Update sphinx_mdinclude to work with mistune v3.0.2.
Fixes: #22
Detailed description of PR
example.md
: Fix two issues: there was a missing space after a close HTML delimiter, and the auto link was just plain text.pyproject.toml
: Update the mistune dependency version numbers.sphinx_mdinclude/parse.py
: quite significant reworking to update to mistune 3.0.2 internals.sphinx_mdinclude/render.py
: likewise. The newrender_token
function is a bit grim, unfortunately. There's probably a nicer way to do it, but this works. I have also fixed a small bug: incodespan()
, if the inline code begins or ends with a space or backquote, then it cannot be rendered using double backquotes (and this broke the inclusion ofchangelog.md
in the documentation).sphinx_mdinclude/tests/__init__.py
: I've renamedTestConplexText
asTestComplexTest
.sphinx_mdinclude/tests/test.rst
: I have modified this to match the output ofconvert(testmd)
, wheretestmd
is the content of thetest.md
file.sphinx_mdinclude/tests/test_renderer.py
: four extra tests for inline code beginning/ending with spaces or quotes. RenameTestConplexText
. In the new mistune, footnote references are all normalised to upper-case; update the expected output inTestFootNote
to this new behaviour.