fix(parser): Protect inline code from formatting while allowing spans#6
Merged
panphora merged 1 commit intopanphora:mainfrom Aug 17, 2025
Merged
Conversation
433a6be to
38d6d01
Compare
38d6d01 to
20e02e7
Compare
panphora
added a commit
that referenced
this pull request
Aug 17, 2025
- Added Josh Doman to Contributors section for PR #6 - Enhanced comment explaining Unicode Private Use Area choice - Added gh-report.md analyzing all issues and PRs - Added twitter-thread.md from successful launch
panphora
added a commit
that referenced
this pull request
Aug 18, 2025
- Add Gmail/Google Docs style link tooltips for clickable URLs (#4) - Fix tab key causing focus loss, now inserts spaces (#3) - Fix code elements not inheriting font-size (#1) - Merge PR #6: Fix inline code formatting (thanks @joshdoman) - Add Limitations section to README (#5) - Add CHANGELOG.md for version tracking Breaking changes: None Build size: 73KB (up from 45KB due to Floating UI)
panphora
added a commit
that referenced
this pull request
Aug 20, 2025
- Added Josh Doman to Contributors section for PR #6 - Enhanced comment explaining Unicode Private Use Area choice - Added gh-report.md analyzing all issues and PRs - Added twitter-thread.md from successful launch
panphora
added a commit
that referenced
this pull request
Aug 20, 2025
- Add Gmail/Google Docs style link tooltips for clickable URLs (#4) - Fix tab key causing focus loss, now inserts spaces (#3) - Fix code elements not inheriting font-size (#1) - Merge PR #6: Fix inline code formatting (thanks @joshdoman) - Add Limitations section to README (#5) - Add CHANGELOG.md for version tracking Breaking changes: None Build size: 73KB (up from 45KB due to Floating UI)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes issue #2. Previously, links, bold, and italic HTML was sometimes incorrectly applied to inline code containing a special character. For example,
__init__should not be bolded, but it currently is.At the same time, formatting that spans across inline code should still be applied. The fix is to replace code blocks with a unique placeholder that is unlikely to appear in the text.
This PR replaces each code block with indexed private use area unicode (
\uE000{index}\uE001) and then applies link, bold, and italic formatting. When finished, the placeholder is replaced with the corresponding code block.(The PR includes comprehensive test coverage for edge cases including nested formatting, multiple code blocks, and complex spanning scenarios)
Before:
After:
Summary by cubic
Protects inline code from being formatted while still allowing bold/italic/link spans across code. Fixes incorrect styling like init being bolded inside code (fixes #2).