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:
Anton Staaf
2017-01-26 11:58:25 -08:00
committed by Bjørn Erik Pedersen
parent 9416fdd334
commit 99fbc75e7a
4 changed files with 59 additions and 45 deletions

View File

@@ -33,6 +33,7 @@ Alternatively, you may add the <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</co
Be careful to enter <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</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