[PR #20811] fix: Docling page number extraction for citations #41423

Open
opened 2026-04-25 13:40:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20811
Author: @jannikstdl
Created: 1/20/2026
Status: 🔄 Open

Base: devHead: fix/docling-page-extraction


📝 Commits (1)

  • ecb41aa fix: docling page extraction

📊 Changes

1 file changed (+34 additions, -4 deletions)

View changed files

📝 backend/open_webui/retrieval/loaders/main.py (+34 -4)

📄 Description

Summary

  • Fix page number extraction from Docling-processed PDFs so CitationModal displays page numbers
  • Use md_page_break_placeholder parameter to split markdown content by page while preserving formatting

Problem

Page numbers from Docling-processed PDFs were not showing in CitationModal because the markdown output had no page boundary information.

Solution

Request Docling to insert page break markers (<!-- DOCLING_PAGE_BREAK -->) between pages in the markdown output, then split on those markers to create one document per page with the page metadata field.

This preserves:

  • Markdown formatting (headers, lists, etc.) for the Markdown Header Text Splitter
  • Page numbers in metadata for CitationModal display

Test plan

  • Upload a multi-page PDF with Docling engine enabled
  • Verify citations show "(page X)" in CitationModal
  • Verify markdown formatting is preserved (headers work with Markdown Header Text Splitter)

Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/20811 **Author:** [@jannikstdl](https://github.com/jannikstdl) **Created:** 1/20/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/docling-page-extraction` --- ### 📝 Commits (1) - [`ecb41aa`](https://github.com/open-webui/open-webui/commit/ecb41aa339686423598cb3f2b35d6394295f9e57) fix: docling page extraction ### 📊 Changes **1 file changed** (+34 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/retrieval/loaders/main.py` (+34 -4) </details> ### 📄 Description ## Summary - Fix page number extraction from Docling-processed PDFs so CitationModal displays page numbers - Use `md_page_break_placeholder` parameter to split markdown content by page while preserving formatting ## Problem Page numbers from Docling-processed PDFs were not showing in CitationModal because the markdown output had no page boundary information. ## Solution Request Docling to insert page break markers (`<!-- DOCLING_PAGE_BREAK -->`) between pages in the markdown output, then split on those markers to create one document per page with the `page` metadata field. This preserves: - Markdown formatting (headers, lists, etc.) for the Markdown Header Text Splitter - Page numbers in metadata for CitationModal display ## Test plan - [ ] Upload a multi-page PDF with Docling engine enabled - [ ] Verify citations show "(page X)" in CitationModal - [ ] Verify markdown formatting is preserved (headers work with Markdown Header Text Splitter) --- Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 13:40:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#41423