diff options
Diffstat (limited to 'markdown/ast_paragraph.go')
| -rw-r--r-- | markdown/ast_paragraph.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/markdown/ast_paragraph.go b/markdown/ast_paragraph.go index a6417e2..b945741 100644 --- a/markdown/ast_paragraph.go +++ b/markdown/ast_paragraph.go @@ -2,8 +2,10 @@ package markdown import ( "errors" - "fmt" "html/template" + "strings" + + "git.anhgelus.world/anhgelus/small-web/dom" ) var ( @@ -27,7 +29,9 @@ func (a *astParagraph) Eval(opt *Option) (template.HTML, *ParseError) { if a.oneLine { return content, nil } - return template.HTML(fmt.Sprintf("<p>%s</p>", trimSpace(content))), nil + return dom.NewParagraph( + template.HTML(strings.TrimSpace(string(content))), + ).Render(), nil } func paragraph(lxs *lexers, oneLine bool) (*astParagraph, *ParseError) { |
