From d4ad5c4cff7183fdbac1c47f3ab0fa1db204397b Mon Sep 17 00:00:00 2001 From: Chip Black Date: Wed, 2 Mar 2011 15:11:01 -0800 Subject: [PATCH] Add support for markdown-style headlines (lines beginning with #) --- www/js/blerg.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 = ''; } -- 2.25.1