SimpleChatTCRV:MarkDown:HorizLine and Unordered list

Allow for other valid char based markers wrt horizontal lines and
unordered lists

?Also allow for spaces after horizontal line marker, in same line?
This commit is contained in:
hanishkvc 2025-11-25 23:02:35 +05:30
parent 781f86fee8
commit 924bb6cb47
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ export class MarkDown {
} }
return return
} }
if (line == '---') { if (line.match(/^[-]{3,}|[*]{3,}|[_]{3,}\s*$/) != null) {
this.unwind_list() this.unwind_list()
this.html += "<hr>\n" this.html += "<hr>\n"
return return
@ -61,7 +61,7 @@ export class MarkDown {
this.html += `<pre class="${matchPre[1]}">\n` this.html += `<pre class="${matchPre[1]}">\n`
return return
} }
let matchUnOrdered = line.match(/^([ ]*)[-*][ ](.*)$/); let matchUnOrdered = line.match(/^([ ]*)[-+*][ ](.*)$/);
if ( matchUnOrdered != null) { if ( matchUnOrdered != null) {
let sList = 'none' let sList = 'none'
let listLvl = 0 let listLvl = 0