mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-08 23:40:40 +02:00
Make all renderhook Text methods return template.HTML
This commit is contained in:
@@ -95,7 +95,7 @@ func (r *htmlRenderer) renderBlockquote(w util.BufWriter, src []byte, node ast.N
|
||||
BaseContext: render.NewBaseContext(ctx, renderer, n, src, nil, ordinal),
|
||||
typ: typ,
|
||||
alertType: alertType,
|
||||
text: hstring.RenderedString(text),
|
||||
text: hstring.RenderedHTML(text),
|
||||
AttributesHolder: attributes.New(n.Attributes(), attributes.AttributesOwnerGeneral),
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ func (r *htmlRenderer) renderBlockquoteDefault(
|
||||
type blockquoteContext struct {
|
||||
hooks.BaseContext
|
||||
|
||||
text hstring.RenderedString
|
||||
text hstring.RenderedHTML
|
||||
alertType string
|
||||
typ string
|
||||
|
||||
@@ -149,7 +149,7 @@ func (c *blockquoteContext) AlertType() string {
|
||||
return c.alertType
|
||||
}
|
||||
|
||||
func (c *blockquoteContext) Text() hstring.RenderedString {
|
||||
func (c *blockquoteContext) Text() hstring.RenderedHTML {
|
||||
return c.text
|
||||
}
|
||||
|
||||
|
@@ -32,9 +32,9 @@ func TestBlockquoteHook(t *testing.T) {
|
||||
block = true
|
||||
title = true
|
||||
-- layouts/_default/_markup/render-blockquote.html --
|
||||
Blockquote: |{{ .Text | safeHTML }}|{{ .Type }}|
|
||||
Blockquote: |{{ .Text }}|{{ .Type }}|
|
||||
-- layouts/_default/_markup/render-blockquote-alert.html --
|
||||
{{ $text := .Text | safeHTML }}
|
||||
{{ $text := .Text }}
|
||||
Blockquote Alert: |{{ $text }}|{{ .Type }}|
|
||||
Blockquote Alert Attributes: |{{ $text }}|{{ .Attributes }}|
|
||||
Blockquote Alert Page: |{{ $text }}|{{ .Page.Title }}|{{ .PageInner.Title }}|
|
||||
|
Reference in New Issue
Block a user