formatter

package
v1.9.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClaspDirectives added in v1.2.0

func ClaspDirectives(doubledRunes []rune, entities []*client.TextEntity) []*client.TextEntity

ClaspDirectives to the following span as required by XEP-0393

func Format

func Format(
	sourceText string,
	entities []*client.TextEntity,
	markupMode MarkupModeType,
) 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 MarkupModeType added in v1.9.0

type MarkupModeType int
const (
	MarkupModeXEP0393 MarkupModeType = iota
	MarkupModeMarkdown
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL