From 3530e6d6d0513d6de06341d4d1827c2dfa0b8408 Mon Sep 17 00:00:00 2001 From: Irvi Firqotul Aini Date: Wed, 13 May 2020 21:50:31 +0700 Subject: [PATCH] Using regex to allow rendering notes with an indent, for example: {{< note >}} If the last element of the path is a substring of the last element in request path, it is not a match (for example: `/foo/bar` matches`/foo/bar/baz`, but does not match `/foo/barbaz`). {{< /note >}} After changin to hugo 0.70 trim seems to be not working. --- layouts/shortcodes/note.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html index 1161c2366c..1da48797c5 100644 --- a/layouts/shortcodes/note.html +++ b/layouts/shortcodes/note.html @@ -1,3 +1,3 @@
-
{{ T "note" }} {{ trim .Inner " \n" | markdownify }}
+
{{ T "note" }} {{ replaceRE "\\s+|\n" " " .Inner | markdownify }}
\ No newline at end of file