mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08:00
Fix "add numbered list" styleSelectedText action
Looks like I missed the `numberedLines` function used by the `orderedList` function in 60dea59815e10d453421117fa681a6474eb29ec8
This commit is contained in:
parent
aa7ea1940f
commit
ef64c2ab35
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user