mdext

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DiscordUnderline = &discordUnderline{}

DiscordUnderline is an extension that allow you to use underline expression like '__text__' .

View Source
var DiscordUnderlineAttributeFilter = html.GlobalAttributeFilter
View Source
var EscapeHTML = &extEscapeHTML{}

EscapeHTML is an extension that escapes HTML in the input markdown instead of passing it through as-is.

View Source
var FixIndentedParagraphs = goldmark.WithParserOptions(parser.WithBlockParsers(util.Prioritized(defaultIndentableParagraphParser, 500)))

FixIndentedParagraphs is a goldmark option which fixes indented paragraphs when disabling CodeBlockParser.

View Source
var LongStrike goldmark.Extender = &shortStrikeExtender{length: 2}
View Source
var ShortEmphasis goldmark.Extender = &shortEmphasisExtender{}
View Source
var ShortStrike goldmark.Extender = &shortStrikeExtender{length: 1}
View Source
var SimpleSpoiler = &simpleSpoiler{}

SimpleSpoiler is an extension that allow you to use simple spoiler expression like '||text||' .

For spoilers with reasons ('||reason|text||'), use the Spoiler extension.

View Source
var Spoiler = &extSpoiler{}

Spoiler is an extension that allow you to use spoiler expression like '||text||' or ||reason|text|| .

There are some types of nested formatting that aren't supported with advanced spoilers. The SimpleSpoiler extension that doesn't support reasons can be used to work around those.

Functions

func NewDiscordUnderlineHTMLRenderer

func NewDiscordUnderlineHTMLRenderer(opts ...html.Option) renderer.NodeRenderer

NewDiscordUnderlineHTMLRenderer returns a new discordUnderlineHTMLRenderer.

func NewDiscordUnderlineParser

func NewDiscordUnderlineParser() parser.InlineParser

NewDiscordUnderlineParser return a new InlineParser that parses Discord underline expressions.

func NewSimpleSpoilerParser

func NewSimpleSpoilerParser() parser.InlineParser

func NewSpoilerHTMLRenderer

func NewSpoilerHTMLRenderer(opts ...html.Option) renderer.NodeRenderer

func NewSpoilerParser

func NewSpoilerParser() parser.InlineParser

func ParserWithoutFeatures

func ParserWithoutFeatures(features ...any) parser.Parser

ParserWithoutFeatures returns a Goldmark parser with the provided default features removed.

e.g. to disable lists, use

markdown := goldmark.New(goldmark.WithParser(
	mdext.ParserWithoutFeatures(goldmark.NewListParser(), goldmark.NewListItemParser())
))

Types

This section is empty.

Jump to

Keyboard shortcuts

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