Fix toggling of the numbered list prefix in Markdown tiddlers (#6697)

* Fix toggling of the numbered list prefix in Markdown tiddlers

* Define startsWith in utils.js because it's not available in ECMAScript5.1
This commit is contained in:
Max Schillinger 2022-05-17 22:31:50 +02:00 committed by GitHub
parent 5ea315fb98
commit 7cbe1e1d83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -25,8 +25,8 @@ exports["prefix-lines"] = function(event,operation) {
$tw.utils.each(lines,function(line,index) {
// Remove and count any existing prefix characters
var count = 0;
while(line.charAt(0) === event.paramObject.character) {
line = line.substring(1);
while($tw.utils.startsWith(line,event.paramObject.character)) {
line = line.substring(event.paramObject.character.length);
count++;
}
// Remove any whitespace