Documentation ¶
Index ¶
- func IsAlnum(c byte) bool
- func IsEmpty(data []byte) int
- func IsLetter(c byte) bool
- func IsPunctuation(c byte) bool
- func IsSpace(c byte) bool
- func NormalizeNewlines(d []byte) []byte
- type Code
- type CodeBlock
- type Container
- type HTMLSpan
- type Image
- type Leaf
- type Link
- type Node
- type Paragraph
- type Parser
- func (p *Parser) AddBlock(b Container) Container
- func (p *Parser) AppendNode(n Node)
- func (p *Parser) Block(data []byte)
- func (p *Parser) Inline(data []byte)
- func (p *Parser) LinksAndImages() ([]Link, []Image)
- func (p *Parser) Parse(input []byte)
- func (p *Parser) RegisterInline(n byte, fn inlineParser) inlineParser
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAlnum ¶
IsAlnum returns true if c is a digit or letter TODO: check when this is looking for ASCII alnum and when it should use unicode
func IsPunctuation ¶
IsPunctuation returns true if c is a punctuation symbol.
func NormalizeNewlines ¶
Types ¶
type Container ¶
type Container interface {
GetContent() []byte // Markdown content of the block nodes
}
type Image ¶
type Image struct { Leaf Destination []byte // Destination is what goes into a href Title []byte // Title is the tooltip thing that goes in a title attribute }
Image represents markdown image node
type Leaf ¶
type Leaf struct { Literal []byte // Text contents of the leaf nodes Content []byte // Markdown content of the block nodes }
Leaf is a type of node that cannot have children
func (Leaf) GetContent ¶
func (Leaf) GetLiteral ¶
type Link ¶
type Link struct { Leaf Destination []byte // Destination is what goes into a href Title []byte // Title is the tooltip thing that goes in a title attribute }
Link represents markdown link node
type Parser ¶
func (*Parser) AppendNode ¶
func (*Parser) Block ¶
Parse Block-level data. Note: this function and many that it calls assume that the input buffer ends with a newline.
func (*Parser) Inline ¶
Inline parses text within a block. Each function returns the number of consumed chars.
func (*Parser) LinksAndImages ¶
func (*Parser) RegisterInline ¶
Click to show internal directories.
Click to hide internal directories.