1.0.11 • Published 1 year ago

contentful-html-rich-text-converter v1.0.11

Weekly downloads
74
License
ISC
Repository
github
Last release
1 year ago

contentful-html-rich-text-converter

This package was built to support migration of rich text into contentful

This package is currently still under development and in beta

Installation

Using npm:

npm install contentful-html-rich-text-converter

Use

const { parseHtml } = require('contentful-html-rich-text-converter');

const html = '<ul><li><p>a</p></li><li><p>b</p></li><li><p>c</p></li></ul><p></p>';
const result = parseHtml(html);
console.log(result);

Output:

  {
  "data": {},
  "content": [
    {
      "data": {},
      "content": [
        {
          "data": {},
          "content": [
            {
              "data": {},
              "marks": [],
              "value": "a",
              "nodeType": "text"
            }
          ],
          "nodeType": "paragraph"
        }
      ],
      "nodeType": "list-item"
    },
    {
      "data": {},
      "content": [
        {
          "data": {},
          "content": [
            {
              "data": {},
              "marks": [],
              "value": "b",
              "nodeType": "text"
            }
          ],
          "nodeType": "paragraph"
        }
      ],
      "nodeType": "list-item"
    },
    {
      "data": {},
      "content": [
        {
          "data": {},
          "content": [
            {
              "data": {},
              "marks": [],
              "value": "c",
              "nodeType": "text"
            }
          ],
          "nodeType": "paragraph"
        }
      ],
      "nodeType": "list-item"
    }
  ],
  "nodeType": "unordered-list"
}

Current Status

Verified

  • <ul>
  • <ol>
  • <li>
  • <b>
  • <u>
  • <i>
  • <p>
  • <hr>
  • <blockquote>
  • <p>
  • <h{1-6}>
  • <a>
  • <code>
  • <br />
  • <table>

In development

  • <img>

##Git Repository

https://github.com/sethimcclaine/contentful-html-rich-text-converter

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago