Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

Package Overview
Dependencies
Maintainers
5
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Plain text renderer for the Rich Text document.

  • 16.2.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

What is @contentful/rich-text-plain-text-renderer?

@contentful/rich-text-plain-text-renderer is an npm package that provides functionality to convert Contentful's rich text documents into plain text. This can be useful for scenarios where you need to extract and manipulate text content without any formatting or HTML tags.

What are @contentful/rich-text-plain-text-renderer's main functionalities?

Convert Rich Text to Plain Text

This feature allows you to convert a Contentful rich text document into a plain text string. The code sample demonstrates how to use the `documentToPlainTextString` function to achieve this.

const { documentToPlainTextString } = require('@contentful/rich-text-plain-text-renderer');
const richTextDocument = {
  nodeType: 'document',
  content: [
    {
      nodeType: 'paragraph',
      content: [
        {
          nodeType: 'text',
          value: 'Hello, world!',
          marks: [],
          data: {}
        }
      ],
      data: {}
    }
  ],
  data: {}
};
const plainText = documentToPlainTextString(richTextDocument);
console.log(plainText); // Output: 'Hello, world!'

Other packages similar to @contentful/rich-text-plain-text-renderer

FAQs

Package last updated on 17 Jul 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc