fix(inline): nested strong inside emphasis correctly parses - #3
fix(inline): nested strong inside emphasis correctly parses#3SyahrulBhudiF wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughInline delimiter scanning was updated for nested emphasis and strong spans, with regression coverage for HTML and React rendering. Bundle size budgets and generated size reports were refreshed with new metrics and timestamps. ChangesNested emphasis parsing
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/inline.ts`:
- Around line 364-370: Update the strong-close lookahead in the inline parsing
logic around the delimiter scan to use the existing delimiter-aware scanning and
eligibility rules instead of raw value.indexOf(delimiter + delimiter, ...).
Ensure escaped or malformed delimiter runs are not treated as matching closes,
and add a regression test covering the escaped-star example.
In `@tests/bundle-size.test.ts`:
- Around line 19-22: Update the React bundle-size assertion in the test to allow
the refreshed recorded size of 6,706 bytes by setting its toBeLessThan threshold
to at least 6,707; leave the other html, octane, and pluggable budgets
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a3ac8af1-0d04-4db8-a090-260a8e245ae9
📒 Files selected for processing (5)
reports/sizes.jsonreports/sizes.mdsrc/inline.tstests/bundle-size.test.tstests/markdown.test.tsx
Description
Fixes emphasis containing a bold word (e.g.
*a **b** c*) rendering as separate<em>runs instead of nested<em><strong>.Root cause
findDelimiterfor single*/_matched the first occurrence greedily, including*characters that start a**strong delimiter. The fixskips delimiter positions that are part of a longer
**run with a matching close, so the single-delimiter scan passes over inner strong spans.Changes
src/inline.ts— infindDelimiter, when scanning for a single*/_closer, skip positions where the character starts a**/__pairthat has a matching close
isWhitespace/isDelimiterWhitespacehelpers (same byte count)*a **b** c*,*see **the docs** here*,_italic __bold__ tail_,*outer **inner***Bundle impact
All well under 0.4% increase. CommonMark baseline preserved (no regressions).
Fixes #2
Summary by CodeRabbit
Bug Fixes
Tests
Documentation