Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

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

Package Overview
Dependencies
Maintainers
39
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Plain text renderer for the Rich Text document.

latest
Source
npmnpm
Version
0.0.0-determined-by-semantic-release
Version published
Maintainers
39
Created
Source

rich-text-plain-text-renderer-demo

Plain text renderer for the Rich Text document.

Installation

Using npm:

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

Using yarn:

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

Usage

import { documentToPlainTextString } from '@contentful/rich-text-plain-text-renderer-demo';

const document = {
  nodeType: 'document',
  nodeClass: 'document',
  content: [
    {
      nodeClass: 'block',
      nodeType: 'paragraph',
      content: [
        {
          nodeClass: 'text',
          nodeType: 'text',
          value: 'Hello',
          marks: [{ nodeType: 'bold' }]
        },
        {
          nodeClass: 'text',
          nodeType: 'text',
          value: ' world!',
          marks: [{ nodeType: 'italic' }]
        },
      ],
    },
  ]
};

documentToPlainTextString(document); // -> Hello world!

FAQs

Package last updated on 26 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts