1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-31 23:26:18 +00:00

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

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