From: Chip Black Date: Wed, 2 Mar 2011 23:11:01 +0000 (-0800) Subject: Add support for markdown-style headlines (lines beginning with #) X-Git-Tag: v1.5~6 X-Git-Url: http://git.bytex64.net/?a=commitdiff_plain;h=d4ad5c4cff7183fdbac1c47f3ab0fa1db204397b;p=blerg.git Add support for markdown-style headlines (lines beginning with #) --- diff --git a/www/js/blerg.js b/www/js/blerg.js index 3c4cc0e..d227a7a 100644 --- a/www/js/blerg.js +++ b/www/js/blerg.js @@ -363,12 +363,12 @@ function mangleRecord(record, template) { endpush = ''; } - // Create headers when lines begin with = - if (l[0] == '=') { - var m = l.match(/^(=+)/); + // Create headers when lines begin with = or # + if (l[0] == '=' || l[0] == '#') { + var m = l.match(/^([=#]+)/); var depth = m[1].length; if (depth <= 5) { - l = l.replace(/^=+\s*/, '').replace(/\s*=+$/, ''); + l = l.replace(/^[=#]+\s*/, '').replace(/\s*[=#]+$/, ''); out.push(''); endpush = ''; }