projects
/
blerg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
839ecb3
)
Add support for markdown-style headlines (lines beginning with #)
author
Chip Black
<bytex64@bytex64.net>
Wed, 2 Mar 2011 23:11:01 +0000
(15:11 -0800)
committer
Chip Black
<bytex64@bytex64.net>
Wed, 2 Mar 2011 23:11:01 +0000
(15:11 -0800)
www/js/blerg.js
patch
|
blob
|
history
diff --git
a/www/js/blerg.js
b/www/js/blerg.js
index
3c4cc0e
..
d227a7a
100644
(file)
--- a/
www/js/blerg.js
+++ b/
www/js/blerg.js
@@
-363,12
+363,12
@@
function mangleRecord(record, template) {
endpush = '</li>';
}
endpush = '</li>';
}
- // 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) {
var depth = m[1].length;
if (depth <= 5) {
- l = l.replace(/^
=+\s*/, '').replace(/\s*=
+$/, '');
+ l = l.replace(/^
[=#]+\s*/, '').replace(/\s*[=#]
+$/, '');
out.push('<h' + depth + '>');
endpush = '</h' + depth + '>';
}
out.push('<h' + depth + '>');
endpush = '</h' + depth + '>';
}