Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

ParseOptions

These are the options recognized by the parse and parseSlice methods.

interface ParseOptions {
context?: ResolvedPos;
findPositions?: {
node: DOMNode;
offset: number;
pos?: number;
}
[]
;
from?: number;
preserveWhitespace?: boolean | "full";
to?: number;
topMatch?: ContentMatch;
topNode?: Node;
}

§Properties

§

A set of additional nodes to count as context when parsing, above the given top node.

§
findPositions?: {
node: DOMNode;
offset: number;
pos?: number;
}
[]
[src]

When given, the parser will, beside parsing the content, record the document positions of the given DOM positions. It will do so by writing to the objects, adding a pos property that holds the document position. DOM positions that are not in the parsed content will not be written to.

§
from?: number
[src]

The child node index to start parsing from.

§
preserveWhitespace?: boolean | "full"
[src]

By default, whitespace is collapsed as per HTML's rules. Pass true to preserve whitespace, but normalize newlines to spaces, and "full" to preserve whitespace entirely.

§
to?: number
[src]

The child node index to stop parsing at.

§

Provide the starting content match that content parsed into the top node is matched against.

§
topNode?: Node
[src]

By default, the content is parsed into the schema's default top node type. You can pass this option to use the type and attributes from a different node as the top container.