[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: Suggestion for wml::fmt::url
- From: Denis Barbier <nospam@thanx>
 
- Date: Fri, 1 Dec 2000 21:59:57 +0100
 
On Sun, Nov 26, 2000 at 08:36:47PM +0100, Axel Beckert wrote:
> 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>
Welcome Axel,
you should write <attributes-quote %attributes /> instead of %attributes.
I am implementing a mechanism to deal with arbitrary attributes.
Currently i believe that only wml::des::navbar has been updated in the
CVS area (not sure, did not work for WML for a while).
This <url> tag will be defined by
  <define-tag url endtag=required>
  {:\
      [[s|\b(http://\S+)|<a href="$1" \
        <attributes-quote <attributes-extract \
                        :a:(.*) %attributes /> />>$1</a>|g]]\
      ...
      %body\
  :}\
  </define-tag>
There are some explanations on
   http://www.engelschall.com/sw/wml/news/list/msg01797.shtml
> 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.
Sounds good, i will certainly commit this change soon, thanks.
-- 
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com