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

@prismicio/richtext

Package Overview
Dependencies
Maintainers
10
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prismicio/richtext

Convert Rich Text raw data to generic tree to simplify serialization

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65K
decreased by-16.94%
Maintainers
10
Weekly downloads
 
Created
Source

A helper to build generic tree from rich text raw json

Get a generic tree from a richtext

  import PrismicRichText from 'prismic-richtext';

  PrismicRichText.asTree(doc.data.myRichText)

Get a serialized tree from a richtext

You can find an example here: https://github.com/prismicio/prismic-dom/blob/master/src/index.js

  import PrismicRichText from 'prismic-richtext';
  // define a serialize function to manage your fragment
  // you can use the 'Element' Helper from PrismicRichText to match the different fragments
  function serialize() {...}
  
  PrismicRichText.serialize(doc.data.myRichText, serialize, htmlSerializer)

FAQs

Package last updated on 24 Sep 2019

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