@prismicio/richtext

    1.1.0 • Public • Published

    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)

    Keywords

    none

    Install

    npm i @prismicio/richtext

    DownloadsWeekly Downloads

    27,600

    Version

    1.1.0

    License

    ISC

    Unpacked Size

    802 kB

    Total Files

    53

    Last publish

    Collaborators

    • miniploum
    • prismic
    • raph22
    • sre
    • arnaudlewis
    • hypervillain
    • amaurycahuet
    • sprite
    • michel.chau
    • gholgot
    • odim
    • fares.droubi
    • prismic-ci
    • lihbr
    • bapmrl
    • benjammartin
    • angeloashmore