format

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 8 Imported by: 41

Documentation

Overview

Copyright 2018 Tulir Asokan

Copyright 2018 Tulir Asokan

Index

Constants

This section is empty.

Variables

View Source
var BlockTags = []string{"p", "h1", "h2", "h3", "h4", "h5", "h6", "ol", "ul", "pre", "blockquote", "div", "hr", "table"}
View Source
var MatrixToURL = regexp.MustCompile("^(?:https?://)?(?:www\\.)?matrix\\.to/#/([#@!+].*)(?:/(\\$.+))?")

Functions

func Digits

func Digits(num int) int

func HTMLToText

func HTMLToText(html string) string

func RenderMarkdown

func RenderMarkdown(text string) mautrix.Content

Types

type HTMLParser

type HTMLParser struct {
	PillConverter           func(mxid, eventID string) string
	TabsToSpaces            int
	Newline                 string
	BoldConverter           TextConverter
	ItalicConverter         TextConverter
	StrikethroughConverter  TextConverter
	UnderlineConverter      TextConverter
	MonospaceBlockConverter TextConverter
	MonospaceConverter      TextConverter
}

func (*HTMLParser) Parse

func (parser *HTMLParser) Parse(htmlData string) string

type TaggedString

type TaggedString struct {
	// contains filtered or unexported fields
}

type TextConverter

type TextConverter func(string) string

Jump to

Keyboard shortcuts

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