From f05fa024f76888e77c101c2b0e2ee38e91cc7433 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Tue, 9 Dec 2014 20:37:51 -0500 Subject: [PATCH] Add a chomp function. - Mostly useful in pipelines. --- content/templates/functions.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/templates/functions.md b/content/templates/functions.md index 4138ffde9..b0fa0d9ed 100644 --- a/content/templates/functions.md +++ b/content/templates/functions.md @@ -252,6 +252,11 @@ Convert all characters in string to titlecase. e.g. `{{title "BatMan"}}` → "Batman" +### chomp +Removes any trailing newline characters. Useful in a pipeline to remove newlines added by other processing (including `markdownify`). + +e.g., `{{chomp "

Blockhead

\n"` → `"

Blockhead

"` + ### highlight Take a string of code and a language, uses Pygments to return the syntax highlighted code in HTML. Used in the [highlight