gatsby-plugin-wordpress-parser
v2.1.3
Published
A Gatsby plugin to turn remote inline assets into local static files, replace internal links by Gatsby links and facilitate parsing posts content.
Downloads
3
Maintainers
Readme
gatsby-plugin-wordpress-parser
Description
Adds custom replacement rules (see Contact Form 7)
How to Use
Wherever you need to display the post content:
import ContentParser from "gatsby-plugin-wordpress-parser";
replace <div dangerouslySetInnerHTML={{ __html: content }} />
with this
<div>
<ContentParser content={content} />
</div>
How to Extend for Contact Form 7
import ContentParser from "gatsby-plugin-wordpress-parser";
import { cf7ParserFunction } from "gatsby-plugin-wpcf7";
replace <div dangerouslySetInnerHTML={{ __html: content }} />
with:
<div>
<ContentParser content={content} customFn={[cf7ParserFunction]} />
</div>