Closed howamith closed 2 years ago
From the top of the head, I think this regex that extracts reST directives: https://github.com/pdoc3/pdoc/blob/4aa70de2221a34a3003a7e5f52a9b91965f0e359/pdoc/html_helpers.py#L325-L328 might "eat up" all the trailing newlines, and therefore the content following appears to be attached to its previous paragraph without a clear break.
Can you check whether adding a suffix "\n"
(or two) here resolves the issue?
https://github.com/pdoc3/pdoc/blob/4aa70de2221a34a3003a7e5f52a9b91965f0e359/pdoc/html_helpers.py#L278-L281
Care to do a PR?
Adding a single "\n"
to the end of what _ToMarkdown._include_file()
returns does indeed fix the issue :)
Yes, happy to submit a PR!
Expected Behavior
When pulling in a markdown table via
.. include::
reStructuredText directive, any remaining content within that docstring simply follows on after said table.Actual Behavior
The remaining content gets included within the table from the
.. include::
ed markdown table.Steps to Reproduce
pdoc3
if it isn't already installed. I was usingpdoc3
in avenv
when I discovered this, but I'd imagine having it installed globally won't affect things.pdoc --html --output-dir doc package --force
doc/package/index.html. You'll notice that everything in the top-level docstring from
package/init.pyafter the
.. include::ed markdown table from
package/table.md` is included in the rendered table, as opposed to after the table, as expected.Additional info
span
) after the table.