3.0.2 • Published 2 years ago

@kaliber/html-to-portable-text v3.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

npm.io

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.

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago