fix: Consider extra quotation styles when hyphenating quoted words#1077
fix: Consider extra quotation styles when hyphenating quoted words#1077osteotek merged 2 commits intocrosspoint-reader:masterfrom
Conversation
📝 WalkthroughWalkthroughExpanded the hyphenation punctuation list by adding Unicode characters U+201A, U+201E and U+2039 to the punctuation recognition in the hyphenation logic; no control-flow or public API changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
lib/Epub/Epub/hyphenation/HyphenationCommon.cpp (1)
85-99: Consider adding related quotation marks for completeness.For full coverage of German and European quotation styles, consider also adding:
0x201A(‚) — single low-9 quotation mark (German single opening quote, pairs with')0x2039(‹) — single left-pointing angle quotation mark (pairs with existing0x203A)This is optional and can be deferred since the current change addresses the specific issue reported.
♻️ Suggested additions
case 0x201E: // „ + case 0x201A: // ‚ case 0x00A0: // no-break space case '{': case '}': case '[': case ']': case '/': + case 0x2039: // ‹ case 0x203A: // ›🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/Epub/Epub/hyphenation/HyphenationCommon.cpp` around lines 85 - 99, Add the two missing quotation characters to the hyphenation break exceptions by including cases for 0x201A (single low-9 quotation mark ‚) and 0x2039 (single left-pointing angle quotation mark ‹) alongside the existing entries in the switch that currently lists 0x00AB, 0x00BB, 0x2018, 0x2019, 0x201C, 0x201D, 0x201E, 0x00A0, '{', '}', '[', ']', '/', 0x203A, 0x2026 in HyphenationCommon.cpp so German/European single-quote styles are treated the same as the other quotation marks.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
lib/Epub/Epub/hyphenation/HyphenationCommon.cpp
🔇 Additional comments (1)
lib/Epub/Epub/hyphenation/HyphenationCommon.cpp (1)
91-91: LGTM! Correct addition of German low-9 quotation mark.The change correctly adds U+201E („) to the punctuation set, enabling proper trimming of German opening quotes before hyphenation. This follows the existing pattern and addresses the reported issue.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@lib/Epub/Epub/hyphenation/HyphenationCommon.cpp`:
- Around line 85-99: Add the two missing quotation characters to the hyphenation
break exceptions by including cases for 0x201A (single low-9 quotation mark ‚)
and 0x2039 (single left-pointing angle quotation mark ‹) alongside the existing
entries in the switch that currently lists 0x00AB, 0x00BB, 0x2018, 0x2019,
0x201C, 0x201D, 0x201E, 0x00A0, '{', '}', '[', ']', '/', 0x203A, 0x2026 in
HyphenationCommon.cpp so German/European single-quote styles are treated the
same as the other quotation marks.
…rosspoint-reader#1077) ## Summary * **What is the goal of this PR?** Address expected hyphenation issue from crosspoint-reader#998 (comment) * Closes crosspoint-reader#998 * **What changes are included?** Add `„` (U+201E, _Double Low-9 Quotation Mark_), `‚` (U+201A, _Single Low-9 Quotation Mark_) and `‹` (U+2039, _Single Left-pointing Angle Quotation Mark_) exceptions, other quote types were handled correctly. **Before** <img width="480" height="155" alt="hyph3" src="https://github.com/user-attachments/assets/e06b4071-2c8c-4814-965d-96fbe302a450" /> **After** <img width="480" height="154" alt="hyph3-fix" src="https://github.com/user-attachments/assets/4f7f5406-e200-451c-8bee-3f410cc84bbe" /> ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_
…rosspoint-reader#1077) ## Summary * **What is the goal of this PR?** Address expected hyphenation issue from crosspoint-reader#998 (comment) * Closes crosspoint-reader#998 * **What changes are included?** Add `„` (U+201E, _Double Low-9 Quotation Mark_), `‚` (U+201A, _Single Low-9 Quotation Mark_) and `‹` (U+2039, _Single Left-pointing Angle Quotation Mark_) exceptions, other quote types were handled correctly. **Before** <img width="480" height="155" alt="hyph3" src="https://github.com/user-attachments/assets/e06b4071-2c8c-4814-965d-96fbe302a450" /> **After** <img width="480" height="154" alt="hyph3-fix" src="https://github.com/user-attachments/assets/4f7f5406-e200-451c-8bee-3f410cc84bbe" /> ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_
…rosspoint-reader#1077) ## Summary * **What is the goal of this PR?** Address expected hyphenation issue from crosspoint-reader#998 (comment) * Closes crosspoint-reader#998 * **What changes are included?** Add `„` (U+201E, _Double Low-9 Quotation Mark_), `‚` (U+201A, _Single Low-9 Quotation Mark_) and `‹` (U+2039, _Single Left-pointing Angle Quotation Mark_) exceptions, other quote types were handled correctly. **Before** <img width="480" height="155" alt="hyph3" src="https://github.com/user-attachments/assets/e06b4071-2c8c-4814-965d-96fbe302a450" /> **After** <img width="480" height="154" alt="hyph3-fix" src="https://github.com/user-attachments/assets/4f7f5406-e200-451c-8bee-3f410cc84bbe" /> ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_
…rosspoint-reader#1077) ## Summary * **What is the goal of this PR?** Address expected hyphenation issue from crosspoint-reader#998 (comment) * Closes crosspoint-reader#998 * **What changes are included?** Add `„` (U+201E, _Double Low-9 Quotation Mark_), `‚` (U+201A, _Single Low-9 Quotation Mark_) and `‹` (U+2039, _Single Left-pointing Angle Quotation Mark_) exceptions, other quote types were handled correctly. **Before** <img width="480" height="155" alt="hyph3" src="https://github.com/user-attachments/assets/e06b4071-2c8c-4814-965d-96fbe302a450" /> **After** <img width="480" height="154" alt="hyph3-fix" src="https://github.com/user-attachments/assets/4f7f5406-e200-451c-8bee-3f410cc84bbe" /> ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_
Summary
„(U+201E, Double Low-9 Quotation Mark),‚(U+201A, Single Low-9 Quotation Mark) and‹(U+2039, Single Left-pointing Angle Quotation Mark) exceptions, other quote types were handled correctly.Before


After
Additional Context
specific areas to focus on).
AI Usage
While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? NO