mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
hugolib: Fix regression of .Truncated evaluation in manual summaries
This fixes the behavior of .Truncated that was introduced with commit
bef496b97e
which was later broken. The
desired behavior is that .Truncated would evaluate to false when there
was nothing after the user defined summary marker.
This also adds a simple unit test to ensure that this feature isn't
broken again. The check for content after the user defined summary
marker is done on the raw content instead of the working copy because
some of the markup renderers add elements after the marker, making it
difficult to determine if there is actually any content.
The behavior (evaluating to false when there is no content, just
summary) is also now documented.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
9416fdd334
commit
99fbc75e7a
@@ -33,6 +33,7 @@ Alternatively, you may add the <code><!--more--></co
|
||||
|
||||
Be careful to enter <code><!--more--></code> exactly, i.e. all lowercase with no whitespace, otherwise it would be treated as regular comment and ignored.
|
||||
|
||||
If there is nothing but spaces and newlines after the summary divider then `.Truncated` will be false.
|
||||
|
||||
## Showing Summaries
|
||||
|
||||
|
Reference in New Issue
Block a user