Fix #434.
This commit is contained in:
@@ -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' : {
|
||||
|
||||
Reference in New Issue
Block a user