Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Fixing and Parsing WordPress Rest Api content in React.
import React from "react";
import parse from "html-react-parser";
import Gist from "super-react-gist";
export default function WpApiContent(props) {
return parse(props.content, {
replace: (domNode) => {
if( === "script" && domNode.attribs.src.indexOf("/") ) {
return (<Gist url={domNode.attribs.src.replace(".js", "")} />)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.