A plugin for converting html to portableText
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))
}
> yarn
> yarn link
> yarn watch
yarn link @kaliber/html-to-portable-text
yarn publish
git push
git push --tags
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.