Skip to content

Commit

Permalink
revert wysiwyg changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahongsf committed Oct 9, 2024
1 parent e5684ab commit 9fb8cb1
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/lib/format-html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,10 @@ const options: HTMLReactParserOptions = {
nodeProps.className += " mb-20 "
return <NodeName {...nodeProps}>{domToReact(domNode.children as DOMNode[], options)}</NodeName>

case "h2":
if (typeof Text !== "undefined" && domNode.children[0] instanceof Text) {
const text = domNode.children[0].data
const id = text.toLowerCase().replace(/\s+/g, "-")
return (
<NodeName {...nodeProps} id={id} className={twMerge("scroll-smooth", nodeProps.className)}>
{domToReact(domNode.children as DOMNode[], options)}
</NodeName>
)
}
return <NodeName {...nodeProps}>{domToReact(domNode.children as DOMNode[], options)}</NodeName>
case "p":
nodeProps.className += " max-w-[100ch]"
case "h1":
case "h2":
case "h3":
case "h4":
case "span":
Expand Down

0 comments on commit 9fb8cb1

Please sign in to comment.