fix(message-parser): parse emojis and inline elements inside headings#39197
fix(message-parser): parse emojis and inline elements inside headings#39197Harshit2405-2004 wants to merge 2 commits intoRocketChat:developfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: f9b5f72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 42 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughGrammar and tests updated to correctly parse emoji and inline markdown inside heading blocks; a patch changeset documents the fix. Tests assert emoji can appear at start, end, and intermixed within headings. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labelstype: bug 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/message-parser/src/grammar.pegjs">
<violation number="1" location="packages/message-parser/src/grammar.pegjs:151">
P2: HeadingChunk now repeats Inline, which can consume EndOfLine; this allows a heading to absorb multiple subsequent non-empty lines into the same heading instead of stopping at the line boundary.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…ent newline absorptions
Proposed changes
Fixes #33067.
The PEG grammar in
message-parserpreviously restricted Heading chunks to rawHeadingStringtokens. This prevented nested inline elements, like Emojis (# :smile:) and bold variations, from being parsed correctly into their structural AST node objects.This PR updates the parser grammar block to evaluate standard
Inlinerules recursively insideHeadingcomponents, restoring native markdown formatting behavior without negatively impacting simple text rendering. Verified by expanding testing capabilities for emoji-nested headlines.Summary by CodeRabbit