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

Replace head with next/head

Open marcfielding1 opened this issue 2 years ago • 1 comments

Heya!

I'm trying to parse HTML into a nextjs component.

I have

const parsedHTML = parse(props.html,{
           replace: domNode => {
              if(domNode.name == 'head'){
                  return <Head>{domNode.children}</Head>
             }

Which promptly explodes(it doesn't copy the content into Head) - what's the correct way to do this please?

marcfielding1 avatar Jul 16 '22 16:07 marcfielding1

What is your error and can you provide a reproducible example @marcfielding1? You can use the next example

remarkablemark avatar Jul 16 '22 18:07 remarkablemark

Closing issue due to lack of activity. Feel free to reopen if you have additional questions.

remarkablemark avatar Nov 29 '22 05:11 remarkablemark