html-to-react-components icon indicating copy to clipboard operation
html-to-react-components copied to clipboard

Unexcpected token

Open fromb2b opened this issue 4 years ago • 1 comments

I was trying to convert this webpage to react: https://www.roseandfood.co.uk/ when I came across Unexcpected token error in between 1882 and 1885 lines here:

https://codesandbox.io/s/elated-lamarr-9obo2?file=/src/convert.js

I use Windows 10 and Node 10. Thank you for your recommandations

fromb2b avatar Jul 28 '20 16:07 fromb2b

Maybe late response, but I had these issues with some whitespaces or invisible characters within the html. Cleaning up the document beforehand helped:

cleanHTML = cleanHTML.replace(/(\r\n|\n|\r)/gm, '').replace(/\s+/g, '');

shapeshifta78 avatar Aug 03 '21 11:08 shapeshifta78