roman01la / html-to-react-components

Converts HTML pages into React components

Home Page:https://roman01la.github.io/html-to-react-components/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inline styling leaves out "px" with line-height conversions

mandajoan opened this issue · comments

I have ran the converter a few times and noticed it does not convert 'line-height' accurately.
Instead of converting it as with other styling items such as 'width' or 'align' where the value is placed in quotation marks (ex. "35px"), it converts it to number only and leaves out the size value and quotation marks. It does make the conversion to camel case.
html2react-texteditorview

example:
Plain html style:

html-inline-styling

same file converted using html-to-react-components

html2react-inline-styling

Hi! Just double checked, you are right. Unfortunately HTML to JSX conversion is done by a separate library so there's no an easy way to solve this issue given the amount of all possible cases for CSS values syntax. Let's leave the issue open for now, and I'll add a note into readme. Thanks!

Had a bit of time to dig deeper and looks like it is fixed. Try 1.6.2 and let me know if it works for you.

I tried running it (After globally installing 1.6.2) and now I get this error with the react-dom dependency:
image

I uninstalled and migrated back to 1.6.1 and it worked fine. So there's just an issue with 1.6.2 with that package.

please try 1.6.3

it worked like a charm :) thank you!