Hi Heremy!

I found in the commentblock.js an overcomplicated regular expression

At the moment it is:

        this.matchRegExp = /\<![ \r\n\t]*(?:--(?:[^\-]|[\r\n]|-[^\-])*--[ 
\r\n\t]*)\>\r?\n/mg;


I propse to replace it with

        this.matchRegExp = /<!\s*--(?:[^-]|-[^-])*--\s*>/g;

Reason for this:

\< \> in javascript the \ is not required.
[ \r\n\t] is just \s
[\r\n] is not required inside the (?: ) because it's already contained in [^-]
\ is not required in [^\-] becaise there is no character before and after the -
m is not required as we don't anchor with ^ or $ so there is no reason to match 
at some \n

I'm not sure about the "g" as this will find globally all comments. Don't you 
just want to find the first?


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to