mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Add markdownify template filter
Note that this is a Markdownify filter, and is named as such; it's not a Asccidoc filter or in any way connected to a Page. Fixes #524
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package tpl
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
@@ -339,3 +340,14 @@ func TestWhere(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestMarkdownify(t *testing.T) {
|
||||
|
||||
result := Markdownify("Hello **World!**")
|
||||
|
||||
expect := template.HTML("<p>Hello <strong>World!</strong></p>\n")
|
||||
|
||||
if result != expect {
|
||||
t.Errorf("Markdownify: got '%s', expected '%s'", result, expect)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user