Skip to content

feat(markdown): add footnote serialization support#569

Open
ShrillHarrier wants to merge 2 commits intodocling-project:mainfrom
ShrillHarrier:dev/md-footnote-serializer
Open

feat(markdown): add footnote serialization support#569
ShrillHarrier wants to merge 2 commits intodocling-project:mainfrom
ShrillHarrier:dev/md-footnote-serializer

Conversation

@ShrillHarrier
Copy link
Copy Markdown

@ShrillHarrier ShrillHarrier commented Mar 26, 2026

This PR is related to the Improved Footnote Serialization in MarkdownDocSerializer.

It is a Feature Request submitted by simonschoe in docling-project.

The features added include serializing a footnote in the form [^{Identifier}]: {Description}. This is done for Table and Picture items, as footnotes are linked to those.

In general, footnotes in .md files should look like:

[^5]: https://github.com/tesseract-ocr/tesseract
[^6]: https://github.com/VikParuchuri/surya
[^7]: https://github.com/lukas-blecher/LaTeX-OCR

Tests Added:

  • test_table_with_footnotes_markdown()
  • test_picture_with_footnotes_markdown()
  • test_table_export_to_markdown_with_footnotes()

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

DCO Check Passed

Thanks @ShrillHarrier, all your commits are properly signed off. 🎉

@mergify
Copy link
Copy Markdown

mergify bot commented Mar 26, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 Require two reviewer for test updates

This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

I, Matthew Panizza <Matthew.Panizza@ibm.com>, hereby add my Signed-off-by to this commit: 73a9a40

Signed-off-by: Matthew Panizza <Matthew.Panizza@ibm.com>
@dosubot
Copy link
Copy Markdown

dosubot bot commented Mar 26, 2026

Related Documentation

1 document(s) may need updating based on files changed in this PR:

Docling

What are the differences between vlm_pipeline_model_local and picture_description_local in Docling, and how do image descriptions, OCR, and table extraction work together? Also, how do the include_annotations and mark_annotations properties affect exported output?
View Suggested Changes
@@ -67,6 +67,9 @@
 - `compact_tables` (bool): Whether to use compact table format without column padding (default: `False`, Markdown only)
 - `traverse_pictures` (bool): Whether to traverse into picture items and serialize their text children (default: `False`)
 
+**Footnote Serialization in Markdown:**
+When tables or pictures have associated footnotes in the document, these footnotes are automatically serialized in the markdown output using standard markdown footnote syntax: `[^{Identifier}]: {Description}`. The identifier is extracted from the first part of the footnote text, and the remaining text becomes the footnote description. This formatting ensures that footnotes attached to Table and Picture items appear correctly in the exported markdown.
+
 **Handling OCR Text in Scanned/Image-Based PDFs:**
 When processing scanned or image-based PDFs with `force_full_page_ocr=True`, the layout model classifies full-page scans as `PictureItem` nodes. OCR text items are added as children of that picture node in the document tree.
 

[Accept] [Decline]

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?  Join Discord

@ShrillHarrier ShrillHarrier changed the title Improved Footnote Serialization in MarkdownDocSerializer #3128 feat(markdown-serializer): add footnote serialization support for markdown Mar 26, 2026
@ShrillHarrier ShrillHarrier changed the title feat(markdown-serializer): add footnote serialization support for markdown feat(markdown): add footnote serialization support Mar 26, 2026
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.

2 participants