diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-08-31 17:25:15 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-08-31 21:05:58 +0200 |
commit | 6d97ee711e834ad4a0d2aca44fafb042008a8429 (patch) | |
tree | 2c3beb6cb9782e8d2a117de6ea977b85c31eb402 /hugolib | |
parent | f738669a4d09ca04619f4d0f89d90c9b414e9f2e (diff) | |
download | hugo-6d97ee711e834ad4a0d2aca44fafb042008a8429.tar.gz hugo-6d97ee711e834ad4a0d2aca44fafb042008a8429.zip |
Make all renderhook Text methods return template.HTML
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/content_render_hooks_test.go | 4 | ||||
-rw-r--r-- | hugolib/page__content.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/hugolib/content_render_hooks_test.go b/hugolib/content_render_hooks_test.go index abe305762..593d01da8 100644 --- a/hugolib/content_render_hooks_test.go +++ b/hugolib/content_render_hooks_test.go @@ -98,8 +98,8 @@ baseURL="https://example.org" P1: {{ $p.Content }} `, - "_default/_markup/render-link.html", `html-link: {{ .Destination | safeURL }}|Text: {{ .Text | safeHTML }}|Plain: {{ .PlainText | safeHTML }}`, - "_default/_markup/render-image.html", `html-image: {{ .Destination | safeURL }}|Text: {{ .Text | safeHTML }}|Plain: {{ .PlainText | safeHTML }}`, + "_default/_markup/render-link.html", `html-link: {{ .Destination | safeURL }}|Text: {{ .Text }}|Plain: {{ .PlainText | safeHTML }}`, + "_default/_markup/render-image.html", `html-image: {{ .Destination | safeURL }}|Text: {{ .Text }}|Plain: {{ .PlainText | safeHTML }}`, ) b.WithContent("p1.md", `--- diff --git a/hugolib/page__content.go b/hugolib/page__content.go index 30caebed0..31080b929 100644 --- a/hugolib/page__content.go +++ b/hugolib/page__content.go @@ -928,7 +928,7 @@ func (c *cachedContentScope) RenderString(ctx context.Context, args ...any) (tem contentToRenderv := args[sidx] - if _, ok := contentToRenderv.(hstring.RenderedString); ok { + if _, ok := contentToRenderv.(hstring.RenderedHTML); ok { // This content is already rendered, this is potentially // a infinite recursion. return "", errors.New("text is already rendered, repeating it may cause infinite recursion") |