From 13707f68d26b81bd9be1eec4b629749791d700e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 3 Mar 2016 15:53:15 +0100 Subject: [PATCH] Add plainify template function To strip away any HTML. May be useful for the .Title in head etc. People may shoot themself in the foot with this, maybe ... The replacement function is pretty fast. --- content/templates/functions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/templates/functions.md b/content/templates/functions.md index 984efc9b1..ef576bb60 100644 --- a/content/templates/functions.md +++ b/content/templates/functions.md @@ -448,6 +448,12 @@ Runs the string through the Markdown processor. The result will be declared as " e.g. `{{ .Title | markdownify }}` +### plainify + +Strips any HTML and returns the plain text version. + +e.g. `{{ "BatMan" | plainify }}` → "BatMan" + ### pluralize Pluralize the given word with a set of common English pluralization rules.