mfm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMfmOption = Option{
	Url: "https://misskey.io",
}

Functions

func MastodonHashtagHandler

func MastodonHashtagHandler(node *html.Node, m MfmNode, serverUrl string)

func ToHtml

func ToHtml(text string, option ...Option) (string, error)

ToHtml converts MFM to HTML.

Types

type MfmNode

type MfmNode struct {
	Type     mfmNodeType
	Props    map[string]any
	Children []MfmNode
}

func Parse

func Parse(text string) ([]MfmNode, error)

Parse parses MFM to nodes.

type Option

type Option struct {
	Url            string
	HashtagHandler func(*html.Node, MfmNode, string)
}

Jump to

Keyboard shortcuts

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