Fixed ordered list markers. #212

This commit is contained in:
Kevin Primm 2016-07-08 17:16:48 -04:00
parent 5081e100a6
commit 74de7be32d

View File

@ -907,7 +907,7 @@ function _toggleLine(cm, name) {
var map = { var map = {
"quote": "> ", "quote": "> ",
"unordered-list": "* ", "unordered-list": "* ",
"ordered-list": "1. " "ordered-list": "%i. "
}; };
for(var i = startPoint.line; i <= endPoint.line; i++) { for(var i = startPoint.line; i <= endPoint.line; i++) {
(function(i) { (function(i) {
@ -915,7 +915,7 @@ function _toggleLine(cm, name) {
if(stat[name]) { if(stat[name]) {
text = text.replace(repl[name], "$1"); text = text.replace(repl[name], "$1");
} else { } else {
text = map[name] + text; text = map[name].replace(/\%i/g, (i - startPoint.line) + 1) + text;
} }
cm.replaceRange(text, { cm.replaceRange(text, {
line: i, line: i,