mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-14 18:34:47 -04:00
hugolib: Fix regression of .Truncated evaluation in manual summaries
This fixes the behavior of .Truncated that was introduced with commit bef496b97e1dc2df8c52b080152d539a58752801 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:
parent
6791d75c7d
commit
07e8588b0d
@ -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.
|
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
|
## Showing Summaries
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user