From 48829d4007dac2d4c9eba37ac4405e144052be21 Mon Sep 17 00:00:00 2001 From: Sebastian Petrescu Date: Mon, 26 Jan 2026 14:32:08 +0200 Subject: [PATCH] Fix bullet points for PDF text extraction Use list-style-position: inside so bullets are part of text flow, not separate positioned elements. Fixes copy/paste issues. Co-Authored-By: Claude Opus 4.5 --- md2pdf.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/md2pdf.py b/md2pdf.py index fe79189..7a982bf 100755 --- a/md2pdf.py +++ b/md2pdf.py @@ -106,7 +106,8 @@ STYLES = { } ul, ol { margin: 0.5em 0; - padding-left: 1.5em; + padding-left: 0; + list-style-position: inside; } li { margin: 0.2em 0; @@ -171,6 +172,7 @@ STYLES = { font-style: italic; color: #555; } + ul, ol { padding-left: 0; list-style-position: inside; } a { color: #000; } """, "dark": """ @@ -221,6 +223,7 @@ STYLES = { padding: 0.5em 1em; margin: 1em 0; } + ul, ol { padding-left: 0; list-style-position: inside; } a { color: #818cf8; } hr { border: none; border-top: 1px solid #374151; margin: 2em 0; } """, @@ -297,7 +300,8 @@ STYLES = { th { font-weight: 400; color: #666; } ul, ol { margin: 0.3em 0; - padding-left: 1.3em; + padding-left: 0; + list-style-position: inside; } li { margin: 0.15em 0;