Strip invisible Unicode chars and expand ligatures on ActualText path

Soft hyphens, zero-width spaces, BOM, ZWNJ/ZWJ, and word joiners now get
stripped in expand_ligatures(). Also call expand_ligatures() on the ActualText
code path which was the only TextItem creation site missing it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-02-23 16:00:08 -08:00
co-authored by Claude Opus 4.6
parent 93c5c21384
commit 1afc1fdaa2
2 changed files with 42 additions and 1 deletions
+1 -1
View File
@@ -594,7 +594,7 @@ pub(crate) fn extract_page_text_items(
.map(|s| s.as_str())
.unwrap_or(&current_font);
items.push(TextItem {
text: at,
text: expand_ligatures(&at),
x,
y,
width,