mrkdwn

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContextKeyContext  = parser.NewContextKey()
	ContextKeyMentions = parser.NewContextKey()
)

Functions

func RoomMentionToHTML

func RoomMentionToHTML(out io.Writer, channelID string, mxid id.RoomID, alias id.RoomAlias, name, serverName string)

func UserMentionToHTML

func UserMentionToHTML(out io.Writer, userID string, mxid id.UserID, name string)

Types

type Params

type Params struct {
	ServerName     string
	GetUserInfo    func(ctx context.Context, userID string) (mxid id.UserID, name string)
	GetChannelInfo func(ctx context.Context, channelID string) (mxid id.RoomID, alias id.RoomAlias, name string)
}

type SlackMrkdwnParser

type SlackMrkdwnParser struct {
	Params   *Params
	Markdown goldmark.Markdown
}

func New

func New(options *Params) *SlackMrkdwnParser

func (*SlackMrkdwnParser) Parse

func (smp *SlackMrkdwnParser) Parse(ctx context.Context, input string, mentions *event.Mentions) (string, error)

Jump to

Keyboard shortcuts

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