[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> block-serialization-default-parser.js (summary)

(no description)

File Size: 485 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 9 functions

  Block()
  Freeform()
  Frame()
  proceed()
  parseJSON()
  nextToken()
  addFreeform()
  addInnerBlock()
  addBlockFromStack()

Functions
Functions that are not part of a class:

Block(blockName, attrs, innerBlocks, innerHTML, innerContent)   X-Ref
Constructs a block object.

param: {string|null}   blockName
param: {Attributes}    attrs
param: {ParsedBlock[]} innerBlocks
param: {string}        innerHTML
param: {string[]}      innerContent
return: {ParsedBlock} The block object.

Freeform(innerHTML)   X-Ref
Constructs a freeform block object.

param: {string} innerHTML
return: {ParsedBlock} The freeform block object.

Frame(block, tokenStart, tokenLength, prevOffset, leadingHtmlStart)   X-Ref
Constructs a frame object.

param: {ParsedBlock} block
param: {number}      tokenStart
param: {number}      tokenLength
param: {number}      prevOffset
param: {number|null} leadingHtmlStart
return: {ParsedFrame} The frame object.

proceed()   X-Ref
Parses the next token in the input document.

return: {boolean} Returns true when there is more tokens to parse.

parseJSON(input)   X-Ref
Parse JSON if valid, otherwise return null

Note that JSON coming from the block comment
delimiters is constrained to be an object
and cannot be things like `true` or `null`

param: {string} input JSON input string to parse
return: {Object|null} parsed JSON if valid

nextToken()   X-Ref
Finds the next token in the document.

return: {Token} The next matched token.

addFreeform(rawLength)   X-Ref
Adds a freeform block to the output.

param: {number} [rawLength]

addInnerBlock(block, tokenStart, tokenLength, lastOffset)   X-Ref
Adds inner block to the parent block.

param: {ParsedBlock} block
param: {number}      tokenStart
param: {number}      tokenLength
param: {number}      [lastOffset]

addBlockFromStack(endOffset)   X-Ref
Adds block from the stack to the output.

param: {number} [endOffset]



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref