2b72df6e by Adam Heath

Change ReparseStaticChildren to accept all Replace options, and remove

internal hard-coded debug setting.
1 parent 094b0ec6
......@@ -4,15 +4,14 @@ import { COMMENT_NODE, DOCUMENT_NODE, DOCTYPE_NODE, ELEMENT_NODE, TEXT_NODE } fr
import { parseHtml, createMatcher, findNode } from 'astro-wt/html'
import { decode } from 'html-entities'
export const ReparseStaticChildren = (replacements, Component) => (props) => {
export const ReparseStaticChildren = (replaceOptions, Component) => (props) => {
const { children = {}, ...rest } = props
const { props: { value: staticHtml } = {} } = children
if (!staticHtml) return <Component {...props}/>
const bodyToParse = String(staticHtml)
const ultra = Replace({
debug: 2,
...replaceOptions,
html: bodyToParse,
replacements,
})
return <Component {...rest}>{ultra}</Component>
......