2.1.3 • Published 1 year ago

gatsby-plugin-wordpress-parser v2.1.3

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
1 year ago

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

Use gatsby-plugin-wpcf7

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>