-
Notifications
You must be signed in to change notification settings - Fork 77
fix(parser): Standardize inline code parser and prevent inline code from being interpreted as a code fence #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <joshdoman@users.noreply.github.com>
- 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
- 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
|
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. |
- 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
- 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
- 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
|
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 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.