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 2016-03-03 15:53:15 +01:00 committed by Steve Francia
parent 411751dbb5
commit 13707f68d2

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.