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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20811
Author: @jannikstdl
Created: 1/20/2026
Status: 🔄 Open
Base:
dev← Head:fix/docling-page-extraction📝 Commits (1)
ecb41aafix: 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
md_page_break_placeholderparameter to split markdown content by page while preserving formattingProblem
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 thepagemetadata field.This preserves:
Test plan
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.