Fix some RenderShortcodes error cases

This issue fixes two cases where `{{__hugo_ctx` artifacts were left in the rendered output:

1. Inclusion when `.RenderShortcodes` is wrapped in HTML.
2. Inclusion of Markdown file without a trailing newline in some cases.

Closes #12854
Updates #12998
This commit is contained in:
Bjørn Erik Pedersen
2024-10-30 18:10:09 +01:00
parent 5fc1639035
commit 1f23b4949c
13 changed files with 283 additions and 141 deletions

View File

@@ -17,6 +17,7 @@ package page
import (
"context"
"fmt"
"html/template"
"github.com/gohugoio/hugo/markup/converter"
@@ -180,6 +181,7 @@ type Page interface {
ContentProvider
TableOfContentsProvider
PageWithoutContent
fmt.Stringer
}
type PageFragment interface {