Skip to content

fix: convert case-insensitive style attributes - #2452

Merged
remarkablemark merged 1 commit into
remarkablemark:masterfrom
Lay-quq:contrib/html-react-parser-style-case
Oct 20, 2026
Merged

remarkablemark merged 1 commit into
remarkablemark:masterfrom
Lay-quq:contrib/html-react-parser-style-case

Conversation

@Lay-quq

@Lay-quq Lay-quq commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What is the motivation for this pull request?

Allow valid HTML with uppercase or mixed-case style attributes to render on the server.

What is the current behavior?

renderToStaticMarkup(parse('<p STYLE="color: red">Hello</p>')) throws because style is left as a string. The attribute name is normalized, but style conversion only reads the original lowercase attributes.style.

What is the new behavior?

Convert the style value after its attribute name is normalized. Unit and SSR regressions cover style, STYLE, and StYlE; the uppercase/mixed-case cases fail on the original code.

Checklist:

  • Conventional Commits
  • Tests: 148 unit tests, 17 ESM tests, 16 integration tests; source statements, branches, functions, and lines remain 100% covered.
  • Types: TypeScript and package type checks passed.

Build, ESLint, and package lint also passed. Chromium and WebKit each passed 146 tests. The Firefox suite could not start locally: its browser-session connection timed out before any tests ran.

AI disclosure: OpenAI Codex implemented the change and ran the checks; a separate AI agent independently reviewed the final patch.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (04dfdac) to head (6d72dba).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2452   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          144       145    +1     
  Branches        55        56    +1     
=========================================
+ Hits           144       145    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@remarkablemark remarkablemark added the bug Something isn't working label Oct 20, 2026

@remarkablemark remarkablemark left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@remarkablemark
remarkablemark merged commit fbfbc8c into remarkablemark:master Oct 20, 2026
12 checks passed
@remarkablemark

Copy link
Copy Markdown
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants