Hi Tobias

I'm sorry I've not been more active in helping you debug these issues;
I've been away from a real computer.

I think the issue here is that your 'match' patterns for both the
formatters include capturing parenthesis. This is not allowed, because
the wikification matching mechanism concatenates all the match
expressions into one giant regexp, and then relies on there being a
1:1 correspondence between each formatter and a single set of
capturing parenthesis. You can see what is going on in the constructor
to the Formatter() object:

https://github.com/TiddlyWiki/tiddlywiki/blob/master/js/FormatterHelpers.js

The built-in "rawText" formatter is a good example of the way to
workaround this problem. Here, the match expression is just the
minimum pattern to trigger the formatter. Then the body resets the
match position to the beginning of the match before testing for the
lookahead regexp:

                this.lookaheadRegExp.lastIndex = w.matchStart;
                var lookaheadMatch = this.lookaheadRegExp.exec(w.source);

This means that the string that triggered the formatter is re-parsed
as part of the lookahead search, allowing capturing parentheses to be
used to extract the bits and pieces.

Best wishes

Jeremy

On Fri, Mar 30, 2012 at 10:23 PM, Tobias Beer <[email protected]> wrote:
> I have narrowed it down a bit.
>
> The error is also provoked, when I empty both handlers, so they do nothing.
>
> This means that:
>
> 1) There is something malformed about either of <match> or
> <lookaheadRegExp>. In general, both seem to at least follow the convention
> that the first is a string and the second a regex.
>
> 2) The handlers don't do something crucial they're supposed to do when
> making use of a lookaheadRegExp.
>
> Keep in mind that in combination with ANY other extra formatter, BOTH
> formatters <hashtag> and <itag> provoke the same error.
>
>
> Tobias.
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/tiddlywikidev/-/Sj2gzaNOXj8J.
>
> 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.



-- 
Jeremy Ruston
mailto:[email protected]
http://www.tiddlywiki.com

-- 
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