From 07e8588b0d1fdbc3011e14bd69a9e99a0f1da970 Mon Sep 17 00:00:00 2001 From: Anton Staaf Date: Thu, 26 Jan 2017 11:58:25 -0800 Subject: [PATCH] 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. --- content/content/summaries.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/content/summaries.md b/content/content/summaries.md index e64d43331..0f2e6433b 100644 --- a/content/content/summaries.md +++ b/content/content/summaries.md @@ -33,6 +33,7 @@ Alternatively, you may add the <!--more--><!--more--> 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