@contentful/rich-text-plain-text-renderer
    TypeScript icon, indicating that this package has built-in type declarations

    15.12.1 • 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

    62,662

    Version

    15.12.1

    License

    MIT

    Unpacked Size

    48.9 kB

    Total Files

    10

    Last publish

    Collaborators

    • cf-aleks
    • jeffm_cf
    • bvkr
    • ebctfl
    • sjouli
    • mayakarabula
    • cf-engit
    • harshil1712
    • paradoja
    • mattvanvoorst-contentful
    • bruce.felt
    • holgerstorm
    • grassator
    • cf-remylenoir
    • mayagillilan
    • ahsen
    • sergej.herbert
    • mar.contentful
    • rowadz_contentful
    • edblankenship
    • kiyutink_contentful
    • roosterhack
    • kurtulus-contentful
    • omasopust-cf
    • cemre.yuksel
    • peacemukke
    • sophiiistika
    • stephanleece
    • dogukano
    • 3b3ziz
    • or_yoffe_contentful
    • hennadii.shymanskyi
    • m.bensalem
    • sxagoraris
    • stathis.xagoraris
    • andreascful
    • richard_moran
    • yvesrijckaert_contentful
    • mehdi_contentful
    • georgpanok
    • riqwan.thahamir
    • piotr.ciazynski
    • felixboenke
    • farruco.sanjurjo
    • ronaldronson
    • silhoue
    • phbschmidt
    • timbeyer
    • kathrinholzmann
    • inbal.gordon
    • poberherr
    • mikita.savanovich
    • laurenceb
    • stupchiy
    • elblivion
    • fabianheymann
    • it-internal
    • sbezludny
    • medturki
    • danwe
    • marina-cf
    • dlitvakb
    • yann-cf
    • makinwa37
    • diacono
    • whydah-gally
    • tauraz
    • cakejelly
    • martin3walker
    • argvk_cf
    • yiotis
    • leonardofreitass
    • hwartig
    • davidfateh
    • dvasylenko
    • ruderngespra
    • janikomu
    • mshaaban0
    • kdamball
    • burakukula
    • gregferg
    • marcolink
    • gosiaszporer
    • miretxu
    • z0al
    • mspagnolo
    • thomas.spiesser
    • kbarnett
    • jwhiles
    • anho
    • didi96
    • fs
    • cgrabo
    • dana_grn
    • andipaetzold-cf
    • eva.martinez
    • lucabianconi
    • denkristoffer
    • luizfonseca
    • juliabiro
    • vinz93
    • jbourne
    • 0mathcrap
    • damienxy
    • roryscarson
    • m99coder-cf
    • loweisz
    • thomas.contentful
    • marceltoben
    • anwar.ahmad
    • massao
    • bohdan.hutsol
    • contentful-ecosystem
    • vida.momenzadeh
    • yuri.mazursky
    • rebecca.koenig
    • annmary