npm

Need private packages and team management tools?Check out npm Orgs. »

@contentful/rich-text-plain-text-renderer

13.4.0 • Public • Published

rich-text-plain-text-renderer

Plain text renderer for the Rich Text document.

Installation

Using npm:

npm install @contentful/rich-text-plain-text-renderer

Using yarn:

yarn add @contentful/rich-text-plain-text-renderer

Usage

import { documentToPlainTextString } from '@contentful/rich-text-plain-text-renderer';
 
const document = {
  nodeType: 'document',
  data: {},
  content: [
    {
      nodeType: 'paragraph',
      data: {},
      content: [
        {
          nodeType: 'text',
          value: 'Hello',
          marks: [{ type: 'bold' }],
          data: {}
        },
        {
          nodeType: 'text',
          value: ' world!',
          marks: [{ type: 'italic' }],
          data: {}
        },
      ],
    },
  ]
};
 
documentToPlainTextString(document); // -> Hello world!

Keywords

none

install

npm i @contentful/rich-text-plain-text-renderer

Downloadsweekly downloads

7,616

version

13.4.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability