formatting

package
v0.0.0-...-d7f39fc Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultReplaces = map[string]ReplaceChars{
	"*":   {"**", "**"},
	"_":   {"__", "__"},
	"~":   {"~~", "~~"},
	"```": {"```", "```"},
}
View Source
var HTMLReplaces = map[string]ReplaceChars{
	"*":   {"<b>", "</b>"},
	"_":   {"<i>", "</i>"},
	"~":   {"<s>", "</s>"},
	"```": {"<code>", "</code>"},
}

Functions

func FindNextClosing

func FindNextClosing(text string, find string) int

func FindNextOpening

func FindNextOpening(text string, find string) int

func Replace

func Replace(waText string, replaces map[string]ReplaceChars) string

func ReplaceChar

func ReplaceChar(text string, find string, replace ReplaceChars) string

Types

type ReplaceChars

type ReplaceChars struct {
	Opening string
	Closing string
}

Jump to

Keyboard shortcuts

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