File: url.src

package info (click to toggle)
wml 2.0.12ds1-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,432 kB
  • ctags: 116
  • sloc: perl: 5,634; sh: 3,663; makefile: 1,004
file content (55 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
##
##  wml::fmt::url - Recognize Uniform Resource Locator
##  Copyright (c) 1997-2001 Ralf S. Engelschall, All Rights Reserved. 
##

<define-tag url endtag=required>
{:\
    [[s|\b(http://\S+)|<a href="$1">$1</a>|g]]\
    [[s|\b(ftp://\S+)|<a href="$1">$1</a>|g]]\
    [[s|\b(gopher://\S+)|<a href="$1">$1</a>|g]]\
    [[s|\b(telnet:\S+)|<a href="$1">$1</a>|g]]\
    [[s|\b(news:\S+)|<a href="$1">$1</a>|g]]\
    [[s|\b(mailto:\S+)|<a href="$1">$1</a>|g]]\
    %body\
:}\
</define-tag>

##EOF##
__END__

=head1 NAME

wml::fmt::url - Recognize Uniform Resource Locator

=head1 SYNOPSIS

 #use wml::fmt::url

 <url>
 ....http://....
 </url>

=head1 DESCRIPTION

The usage is simple: Just surround the text with the C<E<lt>urlE<gt>>
container tag and all contained URLs are recognized and made interactive by
adding HTML C<E<lt>aE<gt>> (anchor) tags.

=head1 AUTHOR

 Ralf S. Engelschall
 rse@engelschall.com
 www.engelschall.com

=head1 REQUIRES

 Internal: P1, P2, P6
 External: --

=head1 SEE ALSO

HTML C<E<lt>aE<gt>> tag.

=cut