Documentation
¶
Overview ¶
Package irc handles IRC text, such as its formatting codes: bold, italic, underline, strikethrough, monospace, reverse, reset, and colours in both the numbered (\x03) and hex (\x04) forms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flatten ¶
Flatten reduces text to a single clean line: formatting codes and other control characters (such as CTCP delimiters) are removed, and runs of whitespace, including newlines, become a single space with none at either end.
func StripFormatting ¶
StripFormatting removes formatting codes from text, leaving what a client would display. Other control characters, including newlines, are kept. Text without any codes is returned as is, so a byte slice result may share its backing array with the input.
Types ¶
type Span ¶
Span is a run of text with one style.
func ParseFormatting ¶
ParseFormatting splits text into spans at its formatting codes, leaving the codes out. Adjacent runs with the same style are merged, so text without codes is a single unstyled span. Empty text gives no spans.