mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
dist: new, linear addsrclinks
This commit is contained in:
parent
806c4c953c
commit
020c5cbb67
1 changed files with 7 additions and 4 deletions
11
dist/addsrclinks
vendored
11
dist/addsrclinks
vendored
|
@ -4,8 +4,9 @@
|
|||
my $root = $ENV{'PLAN9'};
|
||||
my $html = join("", @_);
|
||||
$html =~ s;$root/;XXX$root/;g;
|
||||
while($html =~ /((.|\n)*)XXX($root\/([a-zA-Z0-9_.\/]|−)*[a-zA-Z0-9_\/])((.|\n)*)/){
|
||||
($a, $b, $c) = ($1, $3, $5);
|
||||
$newhtml = "";
|
||||
while($html =~ /XXX($root\/([a-zA-Z0-9_.\/]|−)*[a-zA-Z0-9_\/])/){
|
||||
($a, $b, $c) = ($`, $1, $');
|
||||
$b =~ s/−/-/g;
|
||||
$l = $b;
|
||||
while(! -e $l){
|
||||
|
@ -19,6 +20,8 @@ while($html =~ /((.|\n)*)XXX($root\/([a-zA-Z0-9_.\/]|−)*[a-zA-Z0-9_\/])((.
|
|||
$b = $l;
|
||||
$b =~ s/-/\−/g;
|
||||
$bb =~ s/-/\−/g;
|
||||
$html = "$a<a href=\"$l\">$b</a>$bb$c";
|
||||
$newhtml .= "$a<a href=\"$l\">$b</a>$bb";
|
||||
$html = $c;
|
||||
}
|
||||
print $html;
|
||||
$newhtml .= $html;
|
||||
print $newhtml;
|
||||
|
|
Loading…
Reference in a new issue