mirror of
https://github.com/flarum/framework.git
synced 2025-02-08 20:31:44 +08: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:
parent
1a19856c0c
commit
1d5d0688aa
|
@ -260,3 +260,15 @@ function orderedList(textarea: HTMLTextAreaElement): SelectionRange {
|
||||||
|
|
||||||
return { text, selectionStart, selectionEnd };
|
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…
Reference in New Issue
Block a user