docling-project / docling-project/docling
Bad / corrupted paths for images under Microsoft Windows for `--image-export-mode referenced`
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### Bug
Using command line tool docling to convert (say) PDF to; markdown, html, or html_split_page results in "bad" paths for Windows. Either '\' or URL encoded to `%5C`.
Looks like this is actually in docling-core https://github.com/docling-project/docling-core/blob/2a78701b3fcee511a3b0d5a6acdf82851d70cfe2/docling_core/types/doc/document.py#L5924 or the rendering https://github.com/docling-project/docling-core/blob/2a78701b3fcee511a3b0d5a6acdf82851d70cfe2/docling_core/transforms/serializer/html.py#L1200 - I'm not clear which
### Steps to reproduce
1. Needs a windows environment :-)
2. use sample doc and convert:
docling --no-ocr --to html --image-export-mode referenced tests\data\pdf\picture_classification.pdf
alternatively use Markdown or html.
Seeing

should be

`%5C` is `\`
trying markdown
docling --no-ocr --to md --image-export-mode referenced tests\data\pdf\picture_classification.pdf
seems fine but not ideal

so using windows path, I believe it is reasonable to use '/' in a Markdown file under Windows.
### Docling version
Docling version: 2.102.1
Docling Core version: 2.82.0
Docling IBM Models version: 3.13.3
Docling Parse version: 6.2.0
Python: cpython-312 (3.12.5)
Platform: Windows-11-10.0.22631-SP0
### Python version
Python 3.12.5
Contributor guide
Assessment
This issue has not been assessed yet.