Documentation ¶
Overview ¶
Package plugin contains all the rules that are not part of Commonmark like GitHub Flavored Markdown.
Index ¶
Constants ¶
View Source
const ( VimeoOnlyThumbnail vimeoVariation = iota VimeoWithTitle VimeoWithDescription )
Variables ¶
View Source
var EXPERIMENTAL_Table = []md.Rule{ md.Rule{ Filter: []string{"th", "td"}, Replacement: func(content string, selec *goquery.Selection, opt *md.Options) *string { return md.String(cell(content, selec)) }, }, md.Rule{ Filter: []string{"tr"}, Replacement: func(content string, selec *goquery.Selection, opt *md.Options) *string { borderCells := "" if isHeadingRow(selec) { selec.Children().Each(func(i int, s *goquery.Selection) { border := "---" if align, ok := s.Attr("align"); ok { switch align { case "left": border = ":--" case "right": border = "--:" case "center": border = ":-:" } } borderCells += cell(border, s) }) } text := "\n" + content if borderCells != "" { text += "\n" + borderCells } return &text }, }, }
EXPERIMENTAL_Table converts a html table to markdown.
View Source
var EXPERIMENTAL_YoutubeEmbed = []md.Rule{ md.Rule{ Filter: []string{"iframe"}, Replacement: func(content string, selec *goquery.Selection, opt *md.Options) *string { src := selec.AttrOr("src", "") if !strings.Contains(src, "www.youtube.com") { return nil } alt := selec.AttrOr("title", "") parts := youtubeID.FindStringSubmatch(src) if len(parts) != 2 { return nil } id := parts[1] text := fmt.Sprintf("[![%s](https://img.youtube.com/vi/%s/0.jpg)](https://www.youtube.com/watch?v=%s)", alt, id, id) return &text }, }, }
View Source
var Timeout = time.Second * 10
Functions ¶
func EXPERIMENTAL_VimeoEmbed ¶
func Strikethrough ¶
Strikethrough converts `<strike>`, `<s>`, and `<del>` elements
func TaskListItems ¶
TaskListItems converts checkboxes into task list items.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.