@wordpress/block-serialization-spec-parser
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/wordpress__block-serialization-spec-parser package

5.0.0 • Public • Published

Block Serialization Spec Parser

This library contains the grammar file (grammar.pegjs) for WordPress posts which is a block serialization specification which is used to generate the actual parser which is also bundled in this package.

PEG parser generators are available in many languages, though different libraries may require some translation of this grammar into their syntax. For more information see:

Installation

Install the module

npm install @wordpress/block-serialization-spec-parser --save

Usage

import { parse } from '@wordpress/block-serialization-spec-parser';

parse( '<!-- wp:core/more --><!--more--><!-- /wp:core/more -->' );
// [{"attrs": null, "blockName": "core/more", "innerBlocks": [], "innerHTML": "<!--more-->"}]

Contributing to this package

This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to npm and used by WordPress as well as other software projects.

To find out more about contributing to this package or Gutenberg as a whole, please read the project's main contributor guide.



Code is Poetry.

/@wordpress/block-serialization-spec-parser/

    Package Sidebar

    Install

    npm i @wordpress/block-serialization-spec-parser

    Weekly Downloads

    1,896

    Version

    5.0.0

    License

    GPL-2.0-or-later

    Unpacked Size

    166 kB

    Total Files

    12

    Last publish

    Collaborators

    • riad
    • gutenbergplugin
    • mamaduka
    • ryanwelcher
    • garypendergast
    • aduth
    • adamsilverstein
    • gziolo
    • ntwb
    • noisysocks
    • kadamwhite
    • jorgefilipecosta
    • ellatrix
    • iandunn206
    • whyisjake
    • ockham
    • sirreal
    • nosolosw
    • wpisabel
    • ntsekouras
    • nerrad
    • desrosj
    • talldanwp
    • peterwilsoncc