From 394fc418195ef89f03147bd0a1b11aead472d647 Mon Sep 17 00:00:00 2001 From: Jake Kenneally Date: Sat, 31 Jan 2026 15:11:22 -0500 Subject: [PATCH] add quotes to punctuation list --- lib/Epub/Epub/ParsedText.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Epub/Epub/ParsedText.cpp b/lib/Epub/Epub/ParsedText.cpp index 25f7e5ed..8e38e63b 100644 --- a/lib/Epub/Epub/ParsedText.cpp +++ b/lib/Epub/Epub/ParsedText.cpp @@ -20,10 +20,11 @@ constexpr char SOFT_HYPHEN_UTF8[] = "\xC2\xAD"; constexpr size_t SOFT_HYPHEN_BYTES = 2; // Check if a character is punctuation that should attach to the previous word -// (no space before it). Limited to sentence-ending and clause-separating punctuation -// to avoid false positives with decorative brackets like "[ 1 ]". +// (no space before it). Includes sentence punctuation and closing quotes. +// Excludes brackets/parens to avoid false positives with decorative patterns like "[ 1 ]". bool isAttachingPunctuation(const char c) { - return c == '.' || c == ',' || c == '!' || c == '?' || c == ';' || c == ':'; + return c == '.' || c == ',' || c == '!' || c == '?' || c == ';' || c == ':' || + c == '"' || c == '\''; } // Check if a word consists entirely of punctuation that should attach to the previous word