This commit is contained in:
bootstraponline
2012-07-17 15:22:37 -06:00
parent ccdbd71517
commit d4c05304e9
@@ -44,11 +44,22 @@ var MarkDown = {
search: /(.+)([\n]?)/g,
replace: "* $1$2"
},
/* This looks silly but is completely valid Markdown */
/* based on rdoc.js */
'function-ol' : {
search: /(.+)([\n]?)/g,
replace: "1. $1$2"
exec: function( txt, selText, $field ) {
var count = 1;
// split into lines
var repText = '';
var lines = selText.split("\n");
var hasContent = /[\w]+/;
for ( var i = 0; i < lines.length; i++ ) {
if ( hasContent.test(lines[i]) ) {
repText += (i + 1).toString() + '. ' +
lines[i] + "\n";
}
}
$.GollumEditor.replaceSelection( repText );
}
},
'function-blockquote' : {