Documentation
¶
Index ¶
- func ClaspDirectives(text string, entities []*client.TextEntity) []*client.TextEntity
- func EntityToMarkdown(entity *client.TextEntity) (*Insertion, *Insertion)
- func EntityToXEP0393(entity *client.TextEntity) (*Insertion, *Insertion)
- func Format(sourceText string, entities []*client.TextEntity, ...) string
- func MergeAdjacentEntities(entities []*client.TextEntity) []*client.TextEntity
- func SortEntities(entities []*client.TextEntity) []*client.TextEntity
- type Insertion
- type InsertionStack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClaspDirectives ¶ added in v1.2.0
func ClaspDirectives(text string, entities []*client.TextEntity) []*client.TextEntity
ClaspDirectives to the following span as required by XEP-0393
func EntityToMarkdown ¶
func EntityToMarkdown(entity *client.TextEntity) (*Insertion, *Insertion)
EntityToMarkdown generates the wrapping Markdown tags
func EntityToXEP0393 ¶
func EntityToXEP0393(entity *client.TextEntity) (*Insertion, *Insertion)
EntityToXEP0393 generates the wrapping XEP-0393 tags
func Format ¶
func Format( sourceText string, entities []*client.TextEntity, entityToMarkup func(*client.TextEntity) (*Insertion, *Insertion), ) string
Format traverses an already sorted list of entities and wraps the text in a markup
func MergeAdjacentEntities ¶ added in v1.2.0
func MergeAdjacentEntities(entities []*client.TextEntity) []*client.TextEntity
MergeAdjacentEntities merges entities of a same kind
func SortEntities ¶
func SortEntities(entities []*client.TextEntity) []*client.TextEntity
SortEntities arranges the entities in traversal-ready order
Types ¶
type InsertionStack ¶
type InsertionStack []*Insertion
InsertionStack contains the sequence of insertions from the start or from the end
func (InsertionStack) NewIterator ¶
func (s InsertionStack) NewIterator() func() *Insertion
NewIterator is a second order function that sequentially scans and returns stack elements; starts returning nil when elements are ended
Click to show internal directories.
Click to hide internal directories.