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.
This commit is contained in:
Bjørn Erik Pedersen authored and Steve Francia committed 2016-03-21 20:27:25 -04:00
1 parent 411751dbb5
commit 13707f68d2
1 file changed
+6
+6
View File
@@ -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. `{{ "<b>BatMan</b>" | plainify }}` → "BatMan"
### pluralize
Pluralize the given word with a set of common English pluralization rules.