Skip to content

fix: Consider extra quotation styles when hyphenating quoted words#1077

Merged
osteotek merged 2 commits intocrosspoint-reader:masterfrom
cbix:fix/hyphenate-quoted
Feb 23, 2026
Merged

fix: Consider extra quotation styles when hyphenating quoted words#1077
osteotek merged 2 commits intocrosspoint-reader:masterfrom
cbix:fix/hyphenate-quoted

Conversation

@cbix
Copy link
Contributor

@cbix cbix commented Feb 22, 2026

Summary

Before
hyph3
After
hyph3-fix

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

📝 Walkthrough

Walkthrough

Expanded 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

Cohort / File(s) Summary
Hyphenation punctuation list
lib/Epub/Epub/hyphenation/HyphenationCommon.cpp
Added cases for Unicode punctuation U+201A (‚), U+201E („) and U+2039 (‹) to the isPunctuation switch so these characters are treated as punctuation in hyphenation/text-flow checks.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive Changes are scoped to extending isPunctuation() for hyphenation exceptions; adding 0x201A and 0x2039 characters goes beyond the PR title's U+201E focus but aligns with handling quote types mentioned in the description. Clarify whether additions of 0x201A and 0x2039 were intentional fixes for related quote types or incidental changes; consider documenting all quote character additions in the PR title or description.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses issue #998's third objective (quoted words not hyphenated correctly) by adding U+201E exception to punctuation handling, though it doesn't address the other two hyphenation issues mentioned.
Title check ✅ Passed The title accurately describes the main change: adding support for additional quotation styles (including German low-quote U+201E and other punctuation characters) to the hyphenation logic.
Description check ✅ Passed The PR description clearly relates to the changeset by explaining the specific Unicode characters being added to hyphenation handling and references the linked issue #998.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@cbix cbix marked this pull request as ready for review February 22, 2026 11:00
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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 existing 0x203A)

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

📥 Commits

Reviewing files that changed from the base of the PR and between ecb5b1b and ef0c173.

📒 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.

@cbix cbix changed the title fix: Consider U+201E when hyphenating quoted words fix: Consider extra quotation styles when hyphenating quoted words Feb 22, 2026
@lukestein lukestein requested a review from osteotek February 23, 2026 14:08
@osteotek osteotek merged commit 57250b9 into crosspoint-reader:master Feb 23, 2026
8 checks passed
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 24, 2026
…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**_
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 24, 2026
…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**_
el pushed a commit to el/crosspoint-reader that referenced this pull request Feb 24, 2026
…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**_
el pushed a commit to el/crosspoint-reader that referenced this pull request Feb 24, 2026
…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**_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor hyphenation and text flow issues

3 participants