Context: Python-Markdown/markdown#1495.
If a docstring's first line uses a reference, and that reference is declared in the body, then current summary features will not be able to render the reference.
The only way to be more robust is to actually render a concatenation of all text sections found in the docstring, to then retrieve the first HTML paragraph.
"\n\n".join(section.value for section in sections if section.kind is DocstringSectionKind.text)
p
element and breakDocumenting this as a limitation. Afterall, there are clear semantics for Python docstrings, where the summary is the first line only, separated from the body by a blank line. If the first line depends on the body to be rendered correctly, we could consider it a user error.
Another alternative would be to parse the docstring as Markdown (just parse, not convert) to collect references and footnotes (any other similar item?), to append them back to any summary or text section when rendering.
I thought about doing this (first suggestion) for text sections too, when rendering them. However, if we concatenate from the current section down to the last, I don't think it's possible to robustly retrieve just the content of the current section from the resulting HTML. The "collect refs to append back" suggestion would work, though.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too