docling-project / docling-project/docling
HTML line breaks incorrectly preserved in Markdown output
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### Bug
HTML line breaks are incorrectly preserved in the converted Markdown output, when they should be normalized to a single space. These line breaks are purely cosmetic in the HTML source and should not affect the rendered text.
#### Input document (`lorem.html`)
```html
Lorem Ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
```
#### Actual output
```markdown
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
```
#### Expected output
Line breaks within HTML paragraph tags should be treated as whitespace and converted to single spaces in Markdown output:
```markdown
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
```
### Steps to reproduce
```shell
$ docling lorem.html --to md
```
### Docling version
Docling version: 2.70.0
Docling Core version: 2.60.2
Docling IBM Models version: 3.11.0
Docling Parse version: 4.7.3
Python: cpython-314 (3.14.2)
Platform: Windows-11-10.0.26200-SP0
### Python version
Python 3.14.2
Contributor guide
Assessment
This issue has not been assessed yet.