Hello,
I'm using SyntaxHighlighterPlugin3 from here
http://syntaxhighlighter.tiddlyspace.com/#SyntaxHighlighterPlugin3 , and
have developed a custom brush by adapting one of the existing ones
(Python).<http://syntaxhighlighter.tiddlyspace.com/#SyntaxHighlighterPlugin3>
I have a lists of keywords that start with either * or / e.g. *vget *do
*end /assign /color. If these are processed like normal keywords and put
them in a variable string like:
var keywords = '*vget *do *end /assign /color' TW gives the error message
"SyntaxError: invalid quantifier" when updating.
I looked at the CSS brush "ShBrushCSS.js" and noticed it has a function
(below) that looks like it's pre-processing the keywords string to escape
the regular expression characters that cause it a problem (in my case * and
/)
function getKeywordsCSS(str)
{
return '\\b([a-z_]|)' + str.replace(/ /g,
'(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
};
My question is, what function should I define so that * and / keywords are
highlighted correctly? (or if there's a simpler trick altogether).
I know this isn't really a TW question, but more of a JScript regular
expression one. However I'm not in any other groups, and I imagine that the
JScript experts that create and embellish TW may know the answer.
Thank you,
Bob
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.