fix(editor): html parsing support for unquoted attributes - #1591
fix(editor): html parsing support for unquoted attributes#1591Alexander6060 wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughLowercase MDX components now support qualifying unquoted HTML attribute values. The tokenizer tracks pending values, validates delimiters and incomplete assignments, handles self-closing tags, and applies flow-specific claim rules. Inline lowercase tags can complete after their closing tag. Tests cover MDXish, legacy RMDX, flow and inline tags, malformed assignments, nesting, formatting, and parsed output. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
__tests__/lib/mdxish/utils/mdxish-component-tag-parser.test.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Error while loading rule ' __tests__/lib/micromark/mdx-component.test.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Error while loading rule ' Note This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. Track spend and usage in your billing 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.
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 `@__tests__/lib/mdxish/utils/mdxish-component-tag-parser.test.ts`:
- Around line 456-471: Add direct parser-level assertions for unquoted
attributes that verify both flow and text AST output, rather than only the final
MDXish HAST; apply equivalent coverage to the RMDX engine. Extend the regression
cases for RM-16375 to cover malformed assignments, self-closing tags, whitespace
and line-ending variants, forbidden value delimiters, emphasis variants,
escapes, nesting, blank lines, and formatting differences, naming or labeling
the cases with RM-16375.
In `@lib/micromark/mdx-component/syntax.ts`:
- Around line 96-98: Update the comment near inUnquotedAttr to remove the claim
that CommonMark disallows `/` in unquoted HTML attribute values, while retaining
the accurate explanation about lowercase tags, JSX attribute expressions, and
URL handling.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4c025720-d46d-4c10-9ee9-7ca581ad1e95
📒 Files selected for processing (2)
__tests__/lib/mdxish/utils/mdxish-component-tag-parser.test.tslib/micromark/mdx-component/syntax.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
readmeio/ai(manual)readmeio/gitto(manual)readmeio/markdown(manual)readmeio/readme(manual)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@__tests__/lib/mdxish/utils/mdxish-component-tag-parser.test.ts`:
- Around line 458-476: The RM-16375 regression matrix is incomplete for emphasis
variants, escaped opening tags, nesting, blank lines, whitespace, and formatting
differences. In
__tests__/lib/mdxish/utils/mdxish-component-tag-parser.test.ts:458-476, extend
the shared describe.each coverage so every required edge case has explicit
expected output for both MDXish and legacy RMDX. In
__tests__/lib/micromark/mdx-component.test.ts:28-74, add matching assertions for
claim and MDAST behavior in both flow and text contexts, including all required
edge cases.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e33c464e-0b5a-458d-95e3-7b891a65d091
📒 Files selected for processing (3)
__tests__/lib/mdxish/utils/mdxish-component-tag-parser.test.ts__tests__/lib/micromark/mdx-component.test.tslib/micromark/mdx-component/syntax.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
readmeio/ai(manual)readmeio/gitto(manual)readmeio/markdown(manual)readmeio/readme(manual)
🚧 Files skipped from review as they are similar to previous changes (1)
- lib/micromark/mdx-component/syntax.ts
🎯 What does this PR do?
<a href=https://example.com>.🧪 QA tips
<a href=https://example.com>Example</a>and confirm it renders as a link tohttps://example.com.classvalues work on inline and block tags, such as<span class=example>and<div class=example>.📸 Screenshot