Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/yihui/hugo-xmag.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYihui Xie <xie@yihui.name>2017-07-11 08:25:58 +0300
committerYihui Xie <xie@yihui.name>2017-07-11 08:25:58 +0300
commitfb54a9a50948edbf6ba187760c200f6d8dbdd688 (patch)
tree230b46e49ce63c1c5cab36d3eb684a270349c60a
parent99fbe17f6cf75e0c9de85df8e145d234e76e9964 (diff)
a better regex: do not add ... between consecutive paragraphs
-rw-r--r--layouts/_default/list.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index ffb7215..6451ca1 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -30,7 +30,7 @@
{{ if and .Description (or .Params.use_description .Site.Params.use_description) }}
{{ $.Scratch.Set "summary" .Description }}
{{ else }}
- {{ $.Scratch.Set "summary" (delimit (.Content | findRE "<p.*?>(.|\n)*?</p>") "[&hellip;] ") }}
+ {{ $.Scratch.Set "summary" (delimit (.Content | findRE "(<p.*?>(.|\n)*?</p>\\s*)+") "[&hellip;] ") }}
{{ end }}
{{ ($.Scratch.Get "summary") | plainify | truncate (default 200 .Site.Params.summary_length) | replaceRE "&amp;" "&" | safeHTML }}
</a>