Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /usr/share/doc/perl-Collectd/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/perl-Collectd/wiki2html.pl
#!/usr/bin/perl

use strict;
use warnings;

sub format_link
{
	my $page = shift;
	my $text = @_ ? shift : $page;

	if ($page =~ m/^User:([A-Z][a-z]*)/) {
		return "<em>$text</em>";
	}

	return qq#<a href="/wiki/index.php/$page">$text</a>#;
}

while (<>)
{
	chomp;
	my $line = $_;

	if ($line =~ m/^\* (.+)/) {
		$line = $1;
	} else {
		next;
	}

	$line =~ s#{{Plugin\|([^}]+)}}#<a href="/wiki/index.php/Plugin:$1">$1 plugin</a>#g;
	$line =~ s@\{\{Issue\|([^}]+)\}\}@<a href="/bugs/$1">#$1</a>@g;
	$line =~ s#\[\[([^|]+)\|([^\]]+)\]\]#format_link($1, $2)#ge;
	$line =~ s#\[\[([^|]+)\]\]#format_link($1)#ge;

	$line =~ s#'''(.*?)'''#<strong>$1</strong>#g;
	$line =~ s#''(.*?)''#<em>$1</em>#g;

	print "$line<br />\n";
}

Hry