[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Suggestion for wml::fmt::url
- From: Axel Beckert <nospam@thanx>
- Date: Sun, 26 Nov 2000 20:36:47 +0100
Hi!
I have two suggestions for wml::fmt::url:
1. It's useful to be able to add all parameters (especially target and
class parameters), you can add to some a-href-tag, to url-tags, too.
The easiest way I found to implement this, was to add %attributes to
each parameter:
<define-tag url endtag=required>
{:\
[[s|\b(http://\S+)|<a href="$1" %attributes>$1</a>|g]]\
[[s|\b(ftp://\S+)|<a href="$1" %attributes>$1</a>|g]]\
[[s|\b(gopher://\S+)|<a href="$1" %attributes>$1</a>|g]]\
[[s|\b(telnet:\S+)|<a href="$1" %attributes>$1</a>|g]]\
[[s|\b(news:\S+)|<a href="$1" %attributes>$1</a>|g]]\
[[s|\b(mailto:\S+)|<a href="$1" %attributes>$1</a>|g]]\
%body\
:}\
</define-tag>
2. I don't know, if othe people would like this, but it seems useful
(at least to me :-) to linkify e-mail addresses like
<abe@cs.uni-sb.de> or <abe@cs.uni-sb.de>, too. So I added the
following replacements to the above:
[[s|<(\S+?@\S+?)>|<<a href="mailto:$1" %attributes>$1</a>>|g]]
[[s|<(\S+?@\S+?)>|<<a href="mailto:$1" %attributes>$1</a>>|g]]
The second line is just for being lazy. Due to HTML tags usually do
not contain any "@" before the first white-space, it should work
correct.
P.S.: I'm new to the list, so I hope, I didn't make any nono. :-)
Regards, Axel
--
Axel Beckert - abe@cs.uni-sb.de - http://abe.home.pages.de/
Student of Computer Science, University of Saarland (Germany)
Artificial Intelligence Laboratory (AI Lab), Prof. Dr. W. Wahlster;
WWW-Administrator IBFI Schloss Dagstuhl; Students Representative
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com