contentful-html-to-richtext
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

HTML to Contentful RichText

Installation

npm i contentful-html-to-richtext -s

Usage

This package exposes one simple method called generateRichText:

var parser = require("../");
 
let rt = parser.generateRichText(
  `<a href='mailto:test'>We link!</a>
  <p>this a test is <a href='mailto:test'>inmtext</a> test <b>Can we do it nested?</b> </p> <h1>BIG GUY</h1>but can we do more?`
);
console.log(JSON.stringify(rt, null, 2));

This should produce (if published to Contentful with contentful-management): alt text

Package Sidebar

Install

npm i contentful-html-to-richtext

Weekly Downloads

0

Version

0.1.4

License

MIT

Unpacked Size

46.1 kB

Total Files

7

Last publish

Collaborators

  • benedikt-a