Skip to content

resolves #168 - Fix Strikethrough.plainText to preserve original tilde count#260

Open
stromdotcom wants to merge 1 commit intoswiftlang:mainfrom
stromdotcom:fix/strikethrough-plaintext-tilde-count
Open

resolves #168 - Fix Strikethrough.plainText to preserve original tilde count#260
stromdotcom wants to merge 1 commit intoswiftlang:mainfrom
stromdotcom:fix/strikethrough-plaintext-tilde-count

Conversation

@stromdotcom
Copy link
Copy Markdown

@stromdotcom stromdotcom commented Mar 16, 2026

Summary

Discussion in Issue: #168

Strikethrough plainText computed property always returned single tildes (~text~) even when the source used double tildes (~~text~~) because it simply reconstructs the original text assuming a single tilde was used:

return "~\(childrenPlainText)~"

This change adds a tildeCount computed property that derives the delimiter count from source ranges, and uses it in plainText to return the correct representation.

Strikethrough.plainText always emitted single tildes (`~text~`) even
when the source used double tildes (`~~text~~`). Add a tildeCount
computed property that derives the delimiter count from source ranges,
and use it in plainText to return the correct representation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@stromdotcom stromdotcom changed the title Fix Strikethrough.plainText to preserve original tilde count resolves #168 - Fix Strikethrough.plainText to preserve original tilde count Mar 16, 2026
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.

1 participant