@kaliber/html-to-portable-text
v3.0.2
Published
A plugin for converting html to portableText
Downloads
7
Readme
Kaliber HTML to portableText plugin
A plugin for converting html to portableText
Usage
htmlToPortableText(html, overrides = {})
const htmlToPortableText = require('@kaliber/html-to-portable-text')
const portableText = processHTML('<p><h1>This</strong><em>is HTML</em></p>')
function processHTML(html) {
return removeUndefinedValues(htmlToPortableText(html, { h1: 'heading', h2: 'subheading' }))
}
function removeUndefinedValues(o) {
return JSON.parse(JSON.stringify(o))
}
Development
> yarn
> yarn link
> yarn watch
yarn link @kaliber/html-to-portable-text
Publish
yarn publish
git push
git push --tags
Disclaimer
This library is intended for internal use, we provide no support, use at your own risk. It does not import React, but expects it to be provided, which @kaliber/build can handle for you.
This library is not transpiled.