ProsemirrorEx.Model.MarkType (prosemirror_ex v0.3.0)

Copy Markdown View Source

A mark type is a specification for a type of mark in a schema.

Summary

Functions

Validate attributes against the spec.

Create a mark of this type. attrs may be nil or a map containing only some of the mark's attributes. The others, if they have defaults, will be added.

Check whether this mark type excludes another.

Tests whether there is a mark of this type in the given set. Returns the Mark or nil.

When there is a mark of this type in the given set, a new set without it is returned.

Types

t()

@type t() :: %ProsemirrorEx.Model.MarkType{
  attrs: term(),
  excluded: term(),
  instance: term(),
  name: term(),
  rank: term(),
  schema: term(),
  spec: term()
}

Functions

check_attrs(mark_type, values)

Validate attributes against the spec.

create(type, attrs \\ nil)

Create a mark of this type. attrs may be nil or a map containing only some of the mark's attributes. The others, if they have defaults, will be added.

excludes(arg1, other)

Check whether this mark type excludes another.

is_in_set(type, set)

Tests whether there is a mark of this type in the given set. Returns the Mark or nil.

remove_from_set(type, set)

When there is a mark of this type in the given set, a new set without it is returned.