https://github.com/alturosdestinations/alturos.contentfulhtmltorichtext
Convert HTML to Rich Text objects for Contentful!
https://github.com/alturosdestinations/alturos.contentfulhtmltorichtext
contentful html npm-package typescript
Last synced: about 1 month ago
JSON representation
Convert HTML to Rich Text objects for Contentful!
- Host: GitHub
- URL: https://github.com/alturosdestinations/alturos.contentfulhtmltorichtext
- Owner: AlturosDestinations
- License: mit
- Created: 2019-06-26T14:15:18.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T06:18:34.000Z (almost 4 years ago)
- Last Synced: 2025-04-09T18:17:08.492Z (about 1 month ago)
- Topics: contentful, html, npm-package, typescript
- Language: TypeScript
- Homepage:
- Size: 49.8 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTML to Contentful RichText
[](https://npmjs.org/package/contentful-html-to-richtext)
## Installation
```
npm i contentful-html-to-richtext -s
```
## UsageThis package exposes one simple method called `generateRichText`:
```javascipt
const parser = require("contentful-html-to-richtext");let rt = parser.generateRichText(
`We link!
This a test is in text test Can we do it nested?
BIG GUY
but can we do more?`
);
console.log(JSON.stringify(rt, null, 2));
```This should produce (if published to Contentful with `contentful-management`):
