Fix "add numbered list" styleSelectedText action

Looks like I missed the `numberedLines` function used by the `orderedList` function in dd8323ee36
This commit is contained in:
Alexander Skvortsov 2021-05-14 18:35:11 -04:00
parent 1a19856c0c
commit 1d5d0688aa

View File

@ -260,3 +260,15 @@ function orderedList(textarea: HTMLTextAreaElement): SelectionRange {
return { text, selectionStart, selectionEnd };
}
function numberedLines(lines: string[]) {
let i;
let len;
let index;
const results = [];
for (index = i = 0, len = lines.length; i < len; index = ++i) {
const line = lines[index];
results.push(`${index + 1}. ${line}`);
}
return results;
}