peternewnham / react-html-parser

Converts HTML strings directly into React components and provide a simple way to modify and replace the content.
https://peternewnham.github.io/react-html-parser
MIT License
781 stars 103 forks source link

CSS custom properties are processed incorrectly #79

Open jouni opened 4 years ago

jouni commented 4 years ago

Input HTML string

<div style="--foo: bar;"></div>,

Expected style object output

{ "--foo": "bar"}.

Actual output

{ "-Foo": "bar" }

Relevant part of the code

https://github.com/wrakky/react-html-parser/blob/master/src/utils/inlineStyleToObject.js#L35-L37