[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Suggestion for wml::fmt::url


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

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 &lt;abe@cs.uni-sb.de&gt;, too. So I added the
   following replacements to the above:

[[s|&lt;(\S+?@\S+?)&gt;|&lt;<a href="mailto:$1" %attributes>$1</a>&gt;|g]]
[[s|<(\S+?@\S+?)>|&lt;<a href="mailto:$1" %attributes>$1</a>&gt;|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

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