Skip to content

Add fix for line folding when unicode graphemes.#28

Merged
tmpfs merged 2 commits into
mainfrom
unicode-fold-line-fix
Feb 7, 2026
Merged

Add fix for line folding when unicode graphemes.#28
tmpfs merged 2 commits into
mainfrom
unicode-fold-line-fix

Conversation

@tmpfs
Copy link
Copy Markdown
Owner

@tmpfs tmpfs commented Feb 7, 2026

There were two issues with the line folding logic, first using modulo to test when to wrap could skip line wrapping when a multi-byte grapheme occured just before the amount to wrap_at. The conditional update fixes this. Secondly, we were not including the leading space in the length of the next line, hence we now have 1 + grapheme.len() when folding.

Closes #26.

/cc @Fuerst2718

There were two issues with the line folding logic, first using modulo to
test when to wrap could skip line wrapping when a multi-byte grapheme
occured just before the amount to wrap_at. The conditional update fixes
this. Secondly, we were not including the leading space in the length of
the next line, hence we now have 1 + grapheme.len() when folding.

Closes #26.
@tmpfs tmpfs self-assigned this Feb 7, 2026
@tmpfs tmpfs merged commit 0be54ef into main Feb 7, 2026
1 check passed
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.

vcard.tostring() folding fails (fn fold_line)

1 participant