mdspan

package
v0.0.0-...-7758a72 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func DetectAutomaticLink(s *Context) (consumed int)

func DetectCode

func DetectCode(s *Context) (consumed int)

func DetectEmphasis

func DetectEmphasis(s *Context) (consumed int)

func DetectEscapedChar

func DetectEscapedChar(s *Context) (consumed int)

func DetectImage

func DetectImage(s *Context) (consumed int)
func DetectLink(s *Context) (consumed int)

func Parse

func Parse(buf []byte, detectors []Detector) []md.Tag

Types

type Context

type Context struct {
	Buf      []byte
	Pos      int
	Openings OpeningsStack
	Spans    []Span
}

func (*Context) Emit

func (s *Context) Emit(slice []byte, tag interface{}, selfClose bool)

type Detector

type Detector interface {
	Detect(*Context) (consumed int)
}

type DetectorFunc

type DetectorFunc func(*Context) (consumed int)

func (DetectorFunc) Detect

func (d DetectorFunc) Detect(s *Context) (consumed int)

type MaybeOpening

type MaybeOpening struct {
	Tag string
	Pos int
}

type NodeType

type NodeType int

type OpeningsStack

type OpeningsStack []MaybeOpening

func (OpeningsStack) NullTopmostTagged

func (s OpeningsStack) NullTopmostTagged(tag string) bool

func (OpeningsStack) Peek

func (s OpeningsStack) Peek() *MaybeOpening

func (*OpeningsStack) Pop

func (s *OpeningsStack) Pop()

func (*OpeningsStack) PopTo

func (s *OpeningsStack) PopTo(f func(*MaybeOpening) bool) (MaybeOpening, bool)

func (*OpeningsStack) Push

func (s *OpeningsStack) Push(o MaybeOpening)

type Span

type Span struct {
	// Pos is a subslice of the original input buffer
	Pos       []byte
	Tag       md.Tag
	SelfClose bool
}

Jump to

Keyboard shortcuts

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