When citations appear in a parent that has no other siblings besides this single citation, a spurious </div>
is generated resulting in invalid html code. It appears that this is because the opening <div role="list" class="citation-list">
is not being generated. I've tracked it to this docutils failing to add an opening div for the citation list here:
https://github.com/docutils/docutils/blob/master/docutils/docutils/writers/_html_base.py#L632
It gets then closed here leading to the extra tag:
https://github.com/docutils/docutils/blob/master/docutils/docutils/writers/_html_base.py#L640
Basically, this is due to odd behaviour of previous_sibling: if index relative to parent is zero and there are no other siblings, it returns the node itself instead of None. This looks like a docutils bug, and the attached patch fixes the issue.
Originally reported here: https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/309 .
Also reported here: https://github.com/sphinx-doc/sphinx/issues/10784 .
Links got broken by sourceforge when adding a period to my sentences. Working links:
https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/309
https://github.com/sphinx-doc/sphinx/issues/10784
I confirm that the patch fixes the problem of unmatched
</div>
generation.Diff:
Fixed in [r9126].
Thank you for report, analysis, and patch.
Related
Commit: [r9126]
Fixed in Docutils 0.20
Thank you for the report and patch.