Hi,

SyntaxHighlighterPlugin identifies the different brushes by the used
braces
text .. {{{
css .. /*{{{*/
xml .. <!--{{{-->
js .. //{{{

to have more possibilities I added eg:
{{{ brush:pascal
        VAR a: integer;
        a := 0;
}}}

<!--{{{ brush:pascal --> would also work :)

which will render fine, if highlighter is installed, but won't render
in a vanilla tw. I also like /*{{{*/ as a marker for js instead of //
{{{. But for nice rendering I would change this.

So I am searching for a mechanism, that lets you pass parameters to
the highlighter and also render well, if copied to a vanilla tw. And
it needs to be executable too. eg:

<code js>
        // your code
</code>
was introduced by the "old" plugin, but it only renders well inside a
description block in tw. If you tag it systemConfig, it will throw a
syntax error.

something like this:
//{{{
//<code js>
        // your code
//</code>
//}}}

would work, but I think it is ugly. The new propper syntax for
original SyntaxHighlighter 3.0 is
<code class="brush:js">
        // your code
</code>
or <pre> instead of <code>
which will be easy to implement for tw text content.

=============
What I did to get //{{{ brush:xxx working is:

change the regExp match from //{{{\n to //{{{.*\n which is less strict
and will proper identify the start, and let the highlighter parameters
pass.

The this.lookahadRegExp was changed accordingly, which doesn't render
anything between //{{{ and the first \n. So the parameters are
stripped again.

The w.matchText was shortened to 3 chars for the case, which defined
the lookahead.

An additional test for "{{{some text}}} text\n" is needed because
regExp {{{.*\n lets it pass, which is wrong.

==============
Now searching for a better solution

regards Mario








-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to