Add Blackfriday definition lists extension support

This commit is contained in:
Vincent Batoufflet 2015-06-13 10:02:53 +02:00 committed by Bjørn Erik Pedersen
parent be6cf6a9c6
commit 82cc1ac0f8

View file

@ -71,6 +71,7 @@ var blackfridayExtensionMap = map[string]int{
"headerIds": blackfriday.EXTENSION_HEADER_IDS, "headerIds": blackfriday.EXTENSION_HEADER_IDS,
"titleblock": blackfriday.EXTENSION_TITLEBLOCK, "titleblock": blackfriday.EXTENSION_TITLEBLOCK,
"autoHeaderIds": blackfriday.EXTENSION_AUTO_HEADER_IDS, "autoHeaderIds": blackfriday.EXTENSION_AUTO_HEADER_IDS,
"definitionLists": blackfriday.EXTENSION_DEFINITION_LISTS,
} }
var stripHTMLReplacer = strings.NewReplacer("\n", " ", "</p>", "\n", "<br>", "\n", "<br />", "\n") var stripHTMLReplacer = strings.NewReplacer("\n", " ", "</p>", "\n", "<br>", "\n", "<br />", "\n")
@ -163,7 +164,8 @@ func getMarkdownExtensions(ctx *RenderingContext) int {
blackfriday.EXTENSION_TABLES | blackfriday.EXTENSION_FENCED_CODE | blackfriday.EXTENSION_TABLES | blackfriday.EXTENSION_FENCED_CODE |
blackfriday.EXTENSION_AUTOLINK | blackfriday.EXTENSION_STRIKETHROUGH | blackfriday.EXTENSION_AUTOLINK | blackfriday.EXTENSION_STRIKETHROUGH |
blackfriday.EXTENSION_SPACE_HEADERS | blackfriday.EXTENSION_FOOTNOTES | blackfriday.EXTENSION_SPACE_HEADERS | blackfriday.EXTENSION_FOOTNOTES |
blackfriday.EXTENSION_HEADER_IDS | blackfriday.EXTENSION_AUTO_HEADER_IDS blackfriday.EXTENSION_HEADER_IDS | blackfriday.EXTENSION_AUTO_HEADER_IDS |
blackfriday.EXTENSION_DEFINITION_LISTS
for _, extension := range ctx.getConfig().Extensions { for _, extension := range ctx.getConfig().Extensions {
if flag, ok := blackfridayExtensionMap[extension]; ok { if flag, ok := blackfridayExtensionMap[extension]; ok {
flags |= flag flags |= flag