Class: Post

Post

The Post is an in-memory representation of an editor's document. An editor always has a single post. The post is organized into a list of sections. Each section may be markerable (contains "markers", aka editable text) or non-markerable (e.g., a card). When persisting a post, it must first be serialized (loss-lessly) into mobiledoc using Editor#serialize.

Constructor

new Post()

Source:

Members

hasContent

If the post has no sections, or only has one, blank section, then it does not have content and this method returns false. Otherwise it is true.

Source:

Methods

headPosition() → {Position}

Source:
Returns:

The position at the start of the post (will be a BlankPosition if the post is blank)

Type
Position

markersContainedByRange(range) → {Array}

Parameters:
Name Type Description
range Range
Source:
Returns:

markers that are completely contained by the range

Type
Array

tailPosition() → {Position}

Source:
Returns:

The position at the end of the post (will be a BlankPosition if the post is blank)

Type
Position

toRange() → {Range}

Source:
Returns:

A range encompassing the entire post

Type
Range

trimTo(range) → {Post}

Parameters:
Name Type Description
range Range
Source:
Returns:

A new post, constrained to {range}

Type
Post