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

Mark

A mark is a piece of information that can be attached to a node, such as it being emphasized, in code font, or a link. It has a type and optionally a set of attributes that provide further information (such as the target of the link). Marks are created through a Schema, which controls which types exist and which attributes they have.

class Mark {
readonly attrs: Attrs;
readonly type: MarkType;
 
addToSet(set: readonly Mark[]): readonly Mark[];
eq(other: Mark): boolean;
isInSet(set: readonly Mark[]): boolean;
removeFromSet(set: readonly Mark[]): readonly Mark[];
toJSON(): any;
 
static none: readonly Mark[];
 
static fromJSON(schema: Schema, json: any): Mark;
static sameSet(a: readonly Mark[], b: readonly Mark[]): boolean;
static setFrom(marks?: Mark | readonly Mark[] | null): readonly Mark[];
}

§Properties

§
attrs: Attrs
[src]

The attributes associated with this mark.

§

The type of this mark.

§Methods

§
addToSet(set: readonly Mark[]): readonly Mark[]
[src]

Given a set of marks, create a new set which contains this one as well, in the right position. If this mark is already in the set, the set itself is returned. If any marks that are set to be exclusive with this mark are present, those are replaced by this one.

§
eq(other: Mark): boolean
[src]

Test whether this mark has the same type and attributes as another mark.

§
isInSet(set: readonly Mark[]): boolean
[src]

Test whether this mark is in the given set of marks.

§
removeFromSet(set: readonly Mark[]): readonly Mark[]
[src]

Remove this mark from the given set, returning a new set. If this mark is not in the set, the set itself is returned.

§
toJSON(): any
[src]

Convert this mark to a JSON-serializeable representation.

§Static Properties

§
none: readonly Mark[]
[src]

The empty set of marks.

§Static Methods

§
fromJSON(schema: Schema, json: any): Mark
[src]

Deserialize a mark from JSON.

§
sameSet(a: readonly Mark[], b: readonly Mark[]): boolean
[src]

Test whether two sets of marks are identical.

§
setFrom(marks?: Mark | readonly Mark[] | null): readonly Mark[]
[src]

Create a properly sorted mark set from null, a single mark, or an unsorted array of marks.