From e4d098a3ce52de38862c506418bdfa3acdb10ca9 Mon Sep 17 00:00:00 2001 From: devlinjd Date: Sun, 6 Dec 2015 05:51:03 -0500 Subject: [PATCH] Add safety for implicit Markdown. --- src/gen/template-generator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gen/template-generator.js b/src/gen/template-generator.js index 547579c..121402d 100644 --- a/src/gen/template-generator.js +++ b/src/gen/template-generator.js @@ -28,8 +28,8 @@ var _defaultOpts = { out: function( txt ) { return txt; }, raw: function( txt ) { return txt; }, xml: function( txt ) { return XML(txt); }, - md: function( txt ) { return MD(txt); }, - mdin: function( txt ) { return MD(txt).replace(/^\s*\|\<\/p\>\s*$/gi, ''); }, + md: function( txt ) { return MD( txt || '' ); }, + mdin: function( txt ) { return MD(txt || '' ).replace(/^\s*\|\<\/p\>\s*$/gi, ''); }, lower: function( txt ) { return txt.toLowerCase(); }, link: function( name, url ) { return url ? '' + name + '' : name }