mdext

package
v0.0.0-...-2f03d60 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AutoLinkUserHandle ast.AutoLinkType = ast.AutoLinkURL + 1
)

Variables

View Source
var KindUserHandle = ast.NewNodeKind("UserHandle")

KindUserHandle is a NodeKind of the UserHandle node.

Functions

func NewHandle

func NewHandle() goldmark.Extender

NewHandle creates a new goldmark.Extender that allow you to parse text that seems like a @userhandle

func NewHandleParser

func NewHandleParser() parser.InlineParser

NewHandleParser return a new InlineParser can parse text that seems like a URL.

func NewUserHandleRenderer

func NewUserHandleRenderer(linkifier types.Replacer[[]byte], opts ...html.Option) renderer.NodeRenderer

Types

type UserHandle

type UserHandle struct {
	ast.BaseInline
	// contains filtered or unexported fields
}

An UserHandle struct represents an autolink of the Markdown text.

func NewUserHandle

func NewUserHandle(value *ast.Text) *UserHandle

NewUserHandle returns a new UserHandle node.

func (*UserHandle) Dump

func (n *UserHandle) Dump(source []byte, level int)

Dump implements Node.Dump

func (*UserHandle) Inline

func (n *UserHandle) Inline()

Inline implements Inline.Inline.

func (*UserHandle) Kind

func (n *UserHandle) Kind() ast.NodeKind

Kind implements Node.Kind.

func (*UserHandle) Label

func (n *UserHandle) Label(source []byte) []byte

func (*UserHandle) UserName

func (n *UserHandle) UserName(source []byte) []byte

type UserHandleRenderer

type UserHandleRenderer struct {
	html.Config
	// contains filtered or unexported fields
}

func (*UserHandleRenderer) RegisterFuncs

RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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