mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
32 lines
531 B
Go
32 lines
531 B
Go
package extension
|
|
|
|
import (
|
|
"github.com/yuin/goldmark"
|
|
"github.com/yuin/goldmark/parser"
|
|
)
|
|
|
|
type gfm struct {
|
|
}
|
|
|
|
// GFM is an extension that provides Github Flavored markdown functionalities.
|
|
var GFM = &gfm{}
|
|
|
|
var filterTags = []string{
|
|
"title",
|
|
"textarea",
|
|
"style",
|
|
"xmp",
|
|
"iframe",
|
|
"noembed",
|
|
"noframes",
|
|
"script",
|
|
"plaintext",
|
|
}
|
|
|
|
func (e *gfm) Extend(m goldmark.Markdown) {
|
|
m.Parser().AddOption(parser.WithFilterTags(filterTags...))
|
|
Linkify.Extend(m)
|
|
Table.Extend(m)
|
|
Strikethrough.Extend(m)
|
|
TaskList.Extend(m)
|
|
}
|