Closed flynneva closed 1 year ago
Same thing happens for some .png
images we have as well (generated from needpie
elements from sphinx-needs
), an anchor element is generated directly before it, even though we don't want it to.
Editing line 448 of the translators.py
file by adding two line returns at the end fixes this issue for me:
content = f'<a id="{escape_html_quote(anchor)}"></a>\n\n'
This issue seems to touch multiple bugs, but also some issues with needtables
.
I've pushed a new commit that addresses the following:
needtables
to testsneedtables
that may add text outside of an entry element. This issue is not visible when generating an HTML because the browser can handle buggy HTML.
I suggest reporting this issue to needtables
.Regarding the unwanted anchors, it seems that needtables
explicitly add these anchors. I can't ignore it.
From sphinx-markdown-builder
point-of-view, this is identical to the user adding anchors to its RST file.
The configuration flags allow you to implicitly add anchors to sections and function signatures. They do not affect explicit anchors.
You can install the latest commit and see if it solved this issue for you. If it solves it, I'll upload a new version.
pip uninstall sphinx-markdown-builder
pip install git+https://github.com/liran-funaro/sphinx-markdown-builder.git@main
@liran-funaro I've confirmed that your latest commit works 👍🏼 thanks so much for the quick work / conclusion here.
@flynneva Great! I uploaded the new version: https://pypi.org/project/sphinx-markdown-builder/0.6.5/
Describe the bug
When using needtables in the source rst file, the resulting md table has an anchor (
<a></a>
) directly before the table, with no empty line between it and the table.This causes issues later on for markdown parsers, and ideally all anchors should have a new/blank line directly after it.
Even with setting both anchor settings to
False
for this plugin the markdown still has an anchor in it.To Reproduce Steps to reproduce the behavior:
rst
file with aneedtable
Expected behavior
Either the anchor settings for this plugin can be used to complete remove these anchors from being generated, or there is a new empty line between it and the table.
Environment (please complete the following information):
Additional context Add any other context about the problem here.