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

Re: Suggestion for wml::fmt::url

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

There are some explanations on

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