Open GoogleCodeExporter opened 9 years ago
it would make sense to include the special xmpp protocol into txt2tags (since
it's open source and a new standard).
As a temporary workaround, you can use this preproc rule into your document
header:
%!preproc(html): '\[([^ ].*?) xmpp:([^ ].*?)@([^ ].*?)\]' ''<A
HREF="xmpp:\2@\3">\1</A>''
(I've also copied it to http://wiki.txt2tags.org/index.php/Main/Tips#toc6 )
Strangely, I tried this first, but it doesn't work:
%!preproc: '\[([^ ].*?) xmpp:([^ ].*?)@([^ ].*?)\]' '[\1 xmpp:\2@@AROBASE@@\3]'
%!postproc: '@@AROBASE@@' '@'
the first preproc is converted to [test xmpp:username@example.com?message],
without expending the link as expected because it is a preproc...
Original comment by eforg...@gmail.com
on 20 Nov 2010 at 10:16
actually, since i had no requirement of generalization, i used much simpler
workaround:
%!postproc: MY_JID user@domain
%!postproc: MY_XMPP_URI xmpp:user@domain?message
[MY_JID MY_XMPP_URI]
:-)
But i can imagine other circumstances where one could encounter the same
pitfall. This could be, for example, an url of svn repository like
svn+ssh://username@host.example.net/repo-root/trunk
And similar patterns are not so uncommon. So i suggest to rather restrain the
email matching pattern to not trigger inside link markup, just to be safe.
Original comment by ulid...@gmail.com
on 20 Nov 2010 at 10:54
Hi Max,
You found a bug in the link matcher code, I've opened issue 89 to handle that.
Thanks for the report!
About you solution with postprocs, it's the cleaner and preferred in those
cases where funky URLs are needed. I don't want txt2tags to match every
possible URL scheme out there, because than the possibilities of false
positives are high. Postprocs are there to help in this specific cases.
Thanks for the info about XMPP. It seems to be a popular protocol and we can
consider to include it in the URL matcher. Eric already supported this adding
in comment 1. I'll leave this issue opened for opinions.
Original comment by aureliojargas@gmail.com
on 24 Nov 2010 at 10:18
Original issue reported on code.google.com by
ulid...@gmail.com
on 20 Nov 2010 at 7:24