mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user