Author techtonik
Recipients ezio.melotti, serhiy.storchaka, techtonik
Date 2012-12-14.12:09:13
SpamBayes Score -1.0
Marked as misclassified Yes
On Fri, Dec 14, 2012 at 1:54 PM, Ezio Melotti <> wrote:
> Anatoly, how does trac do it?
> ISTM that the only way to prevent this is to build the DOM of the message
> and avoid applying regex that create links to text nodes that are already
> inside an <a></a>.

Not about Trac, but it is also possible to prevent regex conflicts without
the DOM by excluding matched and replaced regions from processing. For
example, if my regex linkified bug link in the text "see issue 494 on this
tracker", then the subsequent regexp will be called on remaining text parts
separately, i.e. `for text in ["see ", " on this tracker"]`. There just
needs to be a component that manages this process and reconstructs final
text from the pieces.

Now about Trac. The interface description is not very helpful about the
substitution, but it is here (get_wiki_syntax is the key point):
From this description: plugins add their regexps and callback functions,
and then Wiki engine matches regex, it calls corresponding callback on the
text that matched and expects this callback to return expanded HTML. I
don't know if matched text is excluded from further processing, but it only
seems  logical to do so.

This page lists pointers to various proposals that could be useful:
Date User Action Args
2012-12-14 12:09:14techtoniksetrecipients: + techtonik, ezio.melotti, serhiy.storchaka
2012-12-14 12:09:13techtoniklinkissue494 messages
2012-12-14 12:09:13techtonikcreate