fix(parser): Standardize inline code parser and prevent inline code from being interpreted as a code fence#19
Closed
joshdoman wants to merge 9 commits intopanphora:mainfrom
Closed
fix(parser): Standardize inline code parser and prevent inline code from being interpreted as a code fence#19joshdoman wants to merge 9 commits intopanphora:mainfrom
joshdoman wants to merge 9 commits intopanphora:mainfrom
Conversation
Fixes panphora#2. Protects inline code from being formatted while still allowing bold/italic/link spans across code. Uses Unicode Private Use Area placeholders to temporarily replace code blocks during formatting, then restores them afterward. Co-authored-by: Josh Doman <[email protected]>
- Added Josh Doman to Contributors section for PR panphora#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
- Add Gmail/Google Docs style link tooltips for clickable URLs (panphora#4) - Fix tab key causing focus loss, now inserts spaces (panphora#3) - Fix code elements not inheriting font-size (panphora#1) - Merge PR panphora#6: Fix inline code formatting (thanks @joshdoman) - Add Limitations section to README (panphora#5) - Add CHANGELOG.md for version tracking Breaking changes: None Build size: 73KB (up from 45KB due to Floating UI)
- Better naming convention for embedded diagram - Update index.html iframe reference
- Gmail-style link tooltips - Tab key support - Critical bug fixes - Ready for npm publish
…rom being interpreted as a code fence
e11db2c to
f5da0fe
Compare
panphora
added a commit
that referenced
this pull request
Aug 19, 2025
- Accepts PR #19's more comprehensive fix for inline code parsing - Supports multi-backtick delimiters (e.g., ``code with `backticks` inside``) - Stricter code fence detection prevents inline triple backticks from being treated as fences - Includes comprehensive test coverage for edge cases - Thanks to @joshdoman for the improved implementation
Owner
|
Thanks for this more comprehensive fix! The multi-backtick support and improved regex is a much better solution than our quick fix. Merging this now with the conflicts resolved in favor of your implementation. |
panphora
added a commit
that referenced
this pull request
Aug 19, 2025
- Add stricter code fence detection to prevent inline code from being treated as fences - Support multi-backtick inline code delimiters (e.g., ``code with `backtick` inside``) - Uses negative lookbehind/lookahead regex for proper backtick matching - Fixes issue where triple backticks with trailing content were incorrectly parsed as code fences Co-authored-by: PR #19 contributor
panphora
added a commit
that referenced
this pull request
Aug 20, 2025
- Add stricter code fence detection to prevent inline code from being treated as fences - Support multi-backtick inline code delimiters (e.g., ``code with `backtick` inside``) - Uses negative lookbehind/lookahead regex for proper backtick matching - Fixes issue where triple backticks with trailing content were incorrectly parsed as code fences Co-authored-by: PR #19 contributor
panphora
added a commit
that referenced
this pull request
Aug 20, 2025
- Add stricter code fence detection using regex pattern - Support multi-backtick inline code delimiters - Prevent inline code from being interpreted as code fences - Uses negative lookbehind/lookahead for proper backtick matching
Owner
|
Thank you for this excellent fix! Your changes were merged in commit 75e5015. The improvements you made are now in the codebase:
Your contribution has been credited in the README. Thanks again for fixing this important parsing issue! |
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 PR fixes issue #15 with two changes:
Strictly speaking, standard markdown also allows a code fence to begin with more than 3 backticks, provided it is closed by a code fence of equal or greater count (with no non-backtick characters), but given the complexity of implementation with the current architecture, it's probably best to leave that for a future PR.
Example 1
__init__Not a code block
Before:

After:

Example 2
``This is not inline code with
backticksin it``Nor this``
But this is inline code with `backticks` in itNot a code block
Before:

After:

Summary by cubic
Standardized inline code parsing to support multi-backtick delimiters and prevent inline code from being treated as a code fence. This fixes false code blocks and lets inline code include backticks safely.