From cbddb4b3aae50d9bb38c6d8eba42d9b5433e26b8 Mon Sep 17 00:00:00 2001 From: devlinjd Date: Sat, 21 Nov 2015 09:13:21 -0500 Subject: [PATCH] Add convenience filter for links. --- src/gen/template-generator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gen/template-generator.js b/src/gen/template-generator.js index 2e5e00f..dfc4521 100644 --- a/src/gen/template-generator.js +++ b/src/gen/template-generator.js @@ -31,7 +31,9 @@ var _defaultOpts = { xml: function( txt ) { return XML(txt); }, md: function( txt ) { return MD(txt); }, mdin: function( txt ) { return MD(txt).replace(/^\s*\|\<\/p\>\s*$/gi, ''); }, - lower: function( txt ) { return txt.toLowerCase(); } + lower: function( txt ) { return txt.toLowerCase(); }, + link: function( name, url ) { return url ? + '' + name + '' : name } }, prettify: { // ← See https://github.com/beautify-web/js-beautify#options indent_size: 2,