[tw5] Re: editor-auto-list - how to add [ ] to * and #

Hi there!
I have solved this a while back for myself, but only saw this question yesterday! I hope you didn’t wait all this time!

I recommend the following 3 changes in the file $:/plugins/sq/editor-autolist/editor-operation-autolist:

//change line 19 from: var listPrefixRegex = /^((*|#)+)./; to:
var listPrefixRegex = /^((*|#|[ |[x)+).
/;

//change line 50 from: var prefixRegEx = /^((*|#)+)$/; to:
var prefixRegEx = /^((*|#|[ ]|[x])+)$/;

//insert after line 62 (var prefix = match[1]:wink:
if (prefix == "[ " || prefix == “[x”) {prefix += “]”;}

2 Likes