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];)
if (prefix == "[ " || prefix == "[x") {prefix += "]";}



On Wednesday, 20 January 2021 at 04:56:36 UTC-5 Sapphireslinger wrote:

> May I ask how do I add [ ] to * and # in Saq's editor-autolist plugin?
>
> On Thursday, January 14, 2021 at 1:55:33 PM UTC+8 Sapphireslinger wrote:
>
>> Saq's editor-autolist ($:/plugins/sq/editor-autolist) makes * and # 
>> lists effortless. 
>>
>> But tgrosinger's minimalist little checklist 
>> ($:/plugins/tgrosinger/tw5-checklist) 
>> uses [ ] lists.
>>
>> How do I add [ ] to * and # in Saq's code?
>>
>> I tried editing part of 
>> $:/plugins/sq/editor-autolist/editor-operation-autolist 
>> like so:
>>
>> var listPrefixRegex = /^((\*|#|[ ])+).*/; 
>> var match = prevLine.match(listPrefixRegex); 
>> //ensure we only handle lines starting with * or # if(match != null && 
>> match[1]) { 
>> var trimmed = match[0].replace(/\s\s*$/, ''); 
>> var prefixRegEx = /^((\*|#|[ ])+)$/;
>>
>> But It didn't work.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ab108d44-4192-4dc2-8516-0e1e2fb4fea5n%40googlegroups.com.

Reply via email to