source: link stylesheet/js references
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 12 Oct 2009 22:18:20 +0000 (22:18 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 13 Oct 2009 22:38:39 +0000 (22:38 +0000)
source.plp

index 1f3c60037ff34686b27268463037039a0476e5ad..7ae3bdbf4f885c77aa9eed98f2be9ddc1c27679c 100644 (file)
@@ -61,7 +61,8 @@ foreach (@$parsed) {
        my $tag = $_->[0] && ($TYPETAG{ $_->[0] } || 'span');
        my $arg = '';
        print "<$tag$arg class=\"sy-\l$_->[0]\">" if $tag;
        my $tag = $_->[0] && ($TYPETAG{ $_->[0] } || 'span');
        my $arg = '';
        print "<$tag$arg class=\"sy-\l$_->[0]\">" if $tag;
-       if ($_->[0] eq 'Constant' and $_->[1] =~ s/^(')([a-z0-9_.]+\.plp?)(?=\1$)//) {
+       if ($_->[0] eq 'Constant'
+       and $_->[1] =~ s{^(['"])(/?[a-z0-9_.]+\.(?:plp?|css|js))(?=\1$)}{}) {
                printf '%s<a href="%s">%s</a>', $1, "/source/$2", $2;
        }
        if (!$_->[0] and $_->[1] =~ s/^(\s*)([A-Z]\w+(?:::\w+)+)(?![^;\s])//) {
                printf '%s<a href="%s">%s</a>', $1, "/source/$2", $2;
        }
        if (!$_->[0] and $_->[1] =~ s/^(\s*)([A-Z]\w+(?:::\w+)+)(?![^;\s])//) {