mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
Merge da000e919a into 25bf5edc4f
This commit is contained in:
commit
fa4933b815
1 changed files with 10 additions and 0 deletions
|
|
@ -155,6 +155,16 @@ const applyOlMarkdown = ({selectionEnd, selectionStart, message}: ApplySpecificM
|
|||
newEnd = Math.max(selectionEnd - (delimiterLength * count), 0);
|
||||
} else {
|
||||
let count = 0;
|
||||
|
||||
const getLastNumberedLine = (text: string): number => {
|
||||
const match = text.match(/(\d+)\.\s/g);
|
||||
if (match) {
|
||||
return parseInt(match[match.length - 1], 10);
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
getDelimiter.counter = getLastNumberedLine(newPrefix) + 1;
|
||||
|
||||
if (isFirstLineSelected) {
|
||||
multilineSelection = getDelimiter() + multilineSelection;
|
||||
count++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue