Skip to content

Commit 5562651

Browse files
committed
add block tag leakage warning for .Summary
Read more gohugoio/hugo#14044
1 parent a0784f2 commit 5562651

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎content/en/methods/page/Summary.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ To list the pages in a section with a summary beneath each link:
2525
{{ end }}
2626
```
2727

28+
> [!warning]
29+
> `.Summary` may cut block tags like (`blockquote`) in the middle, leading to end-tag recovery by the browser (the end tag will be added before parent's end tag), causing unexpected rendering behaviour. To avoid that wrap `.Summary` usage with `article` or `section` tags.
30+
2831
Depending on content length and how you define the summary, the summary may be equivalent to the content itself. To determine whether the content length exceeds the summary length, use the [`Truncated`] method on a `Page` object. This is useful for conditionally rendering a “read more” link:
2932

3033
```go-html-template

0 commit comments

Comments
 (0)