anatoly techtonik added the comment: On Fri, Dec 14, 2012 at 1:54 PM, Ezio Melotti < metatrac...@psf.upfronthosting.co.za> 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): http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiSyntaxProvider >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: http://trac.edgewall.org/wiki/WikiEngine ---------- status: resolved -> chatting _______________________________________________________ PSF Meta Tracker <metatrac...@psf.upfronthosting.co.za> <http://psf.upfronthosting.co.za/roundup/meta/issue494> _______________________________________________________ _______________________________________________ Tracker-discuss mailing list Tracker-discuss@python.org http://mail.python.org/mailman/listinfo/tracker-discuss