SimpleChatTCRV:Markdown:Ordered and Unordered

Update regex to match both ordered and unordered list
This commit is contained in:
hanishkvc 2025-11-26 11:50:17 +05:30
parent a1dc72ba66
commit 9453a81b95
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ export class MarkDown {
*/ */
process_list_unordered(line) { process_list_unordered(line) {
// spaces followed by - or + or * followed by a space and actual list item // spaces followed by - or + or * followed by a space and actual list item
let matchUnOrdered = line.match(/^([ ]*)[-+*][ ](.*)$/); let matchUnOrdered = line.match(/^([ ]*)([-+*]|[a-zA-Z0-9]\.)[ ](.*)$/);
if (matchUnOrdered != null) { if (matchUnOrdered != null) {
let sList = 'none' let sList = 'none'
let listLvl = 0 let listLvl = 0
@ -79,7 +79,7 @@ export class MarkDown {
} }
} }
if (sList == 'same') { if (sList == 'same') {
this.html += `<li>${matchUnOrdered[2]}</li>\n` this.html += `<li>${matchUnOrdered[3]}</li>\n`
} }
return true return true
} }