Documentation ¶
Index ¶
- Constants
- Variables
- func BlockParsers() []util.PrioritizedValue
- func EmojiURL(emojiID string, animated bool) string
- func InlineParserWithLink() []util.PrioritizedValue
- func InlineParsers() []util.PrioritizedValue
- func Parse(content []byte, opts ...parser.ParseOption) ast.Node
- func ParseWithMessage(b []byte, s store.Cabinet, m *discord.Message, msg bool) ast.Node
- func Unescape(src []byte) []byte
- func UnescapeWriter(w io.Writer) io.Writer
- type Attribute
- type BasicRenderer
- type Emoji
- type Inline
- type Mention
- type Tag
Constants ¶
View Source
const ( InlineEmojiSize = 22 LargeEmojiSize = 48 )
Variables ¶
View Source
var DefaultRenderer renderer.Renderer = &BasicRenderer{}
View Source
var EmptyTag = Tag{}
View Source
var KindEmoji = ast.NewNodeKind("Emoji")
View Source
var KindInline = ast.NewNodeKind("Inline")
View Source
var KindMention = ast.NewNodeKind("Mention")
Functions ¶
func BlockParsers ¶
func BlockParsers() []util.PrioritizedValue
func InlineParserWithLink ¶
func InlineParserWithLink() []util.PrioritizedValue
func InlineParsers ¶
func InlineParsers() []util.PrioritizedValue
func Parse ¶
func Parse(content []byte, opts ...parser.ParseOption) ast.Node
Parse parses the given byte slice with extra options. It does not parse links.
func ParseWithMessage ¶
ParseWithMessage parses the given byte slice with the Discord state and the Message as source for the ast nodes. If msg is false, then links will also be parsed (accordingly to embeds and webhooks, normal messages don't have links).
Types ¶
type BasicRenderer ¶
type BasicRenderer struct{}
BasicRenderer renders the package's ast.Nodes into simple unformatted plain text. It serves as an implementation reference. However, this implementation does not have a state, which is required for Inline and Blockquote.
func (*BasicRenderer) AddOptions ¶
func (r *BasicRenderer) AddOptions(...renderer.Option)
type Inline ¶
type Inline struct { ast.BaseInline Attr Attribute }
Click to show internal directories.
Click to hide internal directories.