/**
 * Converts portable text to strings.
 *
 * Copied and pasted from:
 * https://www.sanity.io/docs/presenting-block-text#plain-text-serialization-ac67a867dd69
 */ function blockContentToString ( blocks = [ ] ) { return ( blocks . map ( ( block ) => { if ( block . _type !== 'block' || ! block . children ) { return '' ; } return block . children . map ( ( child ) => child . text ) . join ( '' ) ; } ) . join ( '\n\n' ) ) ; } export default blockContentToString ;