This project is a demo to show the use of processors in Frontity
In frontity we can define custom Processors for the @frontity/html2react
package to parse the HTML received, detect specific patterns and replace them by a custom content
In this demo there's a processor that, for every HTML displayed in React with <Html2React html={htmlRenderedFromPost} />
, replaces this...
<blockquote class="wp-block-quote">
<p>A day without laughter is a day wasted</p>
<cite>Nicolas Chamfort</cite>
</blockquote>
by this...
<div>
<h3>A day without laughter is a day wasted</h3>
<h5>Nicolas Chamfort</h5>
</div>
The custom processor is defined at /src/processors/quote.js
and is added to the html2react
package at /src/index.js
- At https://test.frontity.org/2016/paris-city-of-light/ you can see the original HTML
- At https://processor-blockquote.vercel.app/2016/paris-city-of-light/ you can see this HTML parsed using the custom processor
This demo was created as a result of this thread in the community forum: https://community.frontity.org/t/integrating-frontity-with-gutenberg/2403
npm install
npx frontity dev
Runs the app in development mode. Open http://localhost:3000 to view it in the browser.