File: wiki2google_code_homepage.pl

package info (click to toggle)
libnginx-mod-http-subs-filter 1%3A0.6.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 800 kB
  • sloc: perl: 6,644; ansic: 921; sh: 57; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 425 bytes parent folder | download | duplicates (10)
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
#!/usr/bin/env perl

use strict;
use warnings;
use bytes;

while (<>) {

    s{\s\[ ( [^\[\s]+ ) \]\s }{" `[`$1`]` "}gixe;

    s{ \[\[ ( [^\]\|]+ ) \| ([^\]]*) \]\] }{"[$1 $2]"}gixe;

    s{'''(.*?)'''}{"`$1`"}ge;
    s{''(.*?)''}{"_$1_"}ge;

    s{^\s*<[^/>]+>\s*$}{\{\{\{\n};
    s{^\s*</[^/]+>\s*$}{\}\}\}};

    if (/^\s*$/) {
        print "\n";
        next;
    }

    s{^\*}{ \*};
    s{^\#}{ \#};

    print $_;
}