textutils

package
v2.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOUBLE_QUOTE = '"'
	SINGLE_QUOTE = '\''
)

Variables

This section is empty.

Functions

func CalculateCodeFence

func CalculateCodeFence(fenceChar rune, content string) string

CalculateCodeFence can be passed the content of a code block and it returns how many fence characters (` or ~) should be used.

This is useful if the html content includes the same fence characters for example ``` -> https://stackoverflow.com/a/49268657

func CalculateCodeFenceOccurrences

func CalculateCodeFenceOccurrences(fenceChar rune, content string) int

func CollapseInlineCodeContent

func CollapseInlineCodeContent(content []byte) []byte

func DelimiterForEveryLine

func DelimiterForEveryLine(text []byte, delimiter []byte) []byte

DelimiterForEveryLine puts the delimiter not just at the start and end of the string but if the text is divided on multiple lines, puts the delimiters on every line with content.

Otherwise the bold/italic delimiters won't be recognized if it contains new line characters.

func EscapeMultiLine

func EscapeMultiLine(content []byte) []byte

func PrefixLines

func PrefixLines(source []byte, repl []byte) []byte

func SurroundBy

func SurroundBy(content []byte, chars []byte) []byte

func SurroundByQuotes

func SurroundByQuotes(content []byte) []byte

func SurroundingSpaces

func SurroundingSpaces(content []byte) ([]byte, []byte, []byte)

func TrimConsecutiveNewlines

func TrimConsecutiveNewlines(source []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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