diff options
author | Yihui Xie <xie@yihui.name> | 2017-07-11 08:25:58 +0300 |
---|---|---|
committer | Yihui Xie <xie@yihui.name> | 2017-07-11 08:25:58 +0300 |
commit | fb54a9a50948edbf6ba187760c200f6d8dbdd688 (patch) | |
tree | 230b46e49ce63c1c5cab36d3eb684a270349c60a | |
parent | 99fbe17f6cf75e0c9de85df8e145d234e76e9964 (diff) |
a better regex: do not add ... between consecutive paragraphs
-rw-r--r-- | layouts/_default/list.html | 2 |
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>") "[…] ") }} + {{ $.Scratch.Set "summary" (delimit (.Content | findRE "(<p.*?>(.|\n)*?</p>\\s*)+") "[…] ") }} {{ end }} {{ ($.Scratch.Get "summary") | plainify | truncate (default 200 .Site.Params.summary_length) | replaceRE "&" "&" | safeHTML }} </a> |