Skip to content

feat(converter): align footnote/endnote rendering with LibreOffice#90

Merged
JSv4 merged 2 commits intomainfrom
feature/footnote-rendering-libreoffice-alignment
Dec 22, 2025
Merged

feat(converter): align footnote/endnote rendering with LibreOffice#90
JSv4 merged 2 commits intomainfrom
feature/footnote-rendering-libreoffice-alignment

Conversation

@JSv4
Copy link
Copy Markdown
Owner

@JSv4 JSv4 commented Dec 22, 2025

Summary

  • Remove brackets from footnote/endnote reference numbers ([2]2)
  • Put <sup> inside anchor tag like LibreOffice does for clean inline rendering
  • Skip span wrapper for runs containing only footnote/endnote references to prevent whitespace issues
  • Move backref arrow () inside last paragraph to prevent line breaks
  • Skip runs containing only w:footnoteRef/w:endnoteRef placeholder elements

Before/After Comparison

Before (Docxodus):

<span class="pt-FootnoteReference">
  <sup>
    <a href="#footnote-2">[2]</a>
  </sup>
</span>

After (Docxodus):

<a href="#footnote-2" class="footnote-ref"><sup>2</sup></a>

LibreOffice (target):

<a class="sdfootnoteanc" href="#sdfootnote2sym"><sup>2</sup></a>

Test plan

  • All 1174 tests pass
  • Visual comparison with LibreOffice HTML output
  • Verified footnotes section renders correctly
  • Verified backref arrows appear inline with footnote text

JSv4 and others added 2 commits December 22, 2025 18:00
- Remove brackets from footnote/endnote reference numbers ([2] → 2)
- Put <sup> inside anchor tag like LibreOffice does
- Skip span wrapper for runs containing only footnote/endnote references
  to prevent whitespace issues from nested elements
- Move backref arrow inside last paragraph to prevent line breaks
- Skip runs containing only w:footnoteRef/w:endnoteRef placeholders

Before: <span class="pt-FootnoteReference"><sup><a>[2]</a></sup></span>
After:  <a class="footnote-ref"><sup>2</sup></a>

LibreOffice: <a class="sdfootnoteanc"><sup>1</sup></a>
@JSv4 JSv4 merged commit c44fc55 into main Dec 22, 2025
6 checks passed
@JSv4 JSv4 deleted the feature/footnote-rendering-libreoffice-alignment branch December 22, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant