Hopefully reduce needless whitespace
This commit is contained in:
parent
29d4eb5b8d
commit
13348a3c45
|
@ -199,10 +199,12 @@ sub parse($$$) {
|
|||
print '<blockquote>', escape(trimLeft(substr $line, 1)), '</blockquote>', "\n";
|
||||
}
|
||||
|
||||
elsif ($line eq "") {
|
||||
print '<br/>', "\n";
|
||||
}
|
||||
|
||||
else {
|
||||
print '<p>';
|
||||
print (length($line) == 0 ? '<br/>' : escape $line);
|
||||
print '</p>', "\n";
|
||||
print '<p>', escape($line), '</p>', "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
<h1>Hello, world!</h1>
|
||||
<p>Lorem ipsum dolor sit amet</p>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" href="style.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello, world!</h1>
|
||||
<p>Lorem ipsum dolor sit amet</p>
|
||||
</body>
|
||||
</html>
|
30
t/script.pl
30
t/script.pl
|
@ -7,27 +7,17 @@ sub test($$$) {
|
|||
my ($cmd,$file,$expected) = @_;
|
||||
|
||||
my $res = readpipe($cmd . " < t/" . $file);
|
||||
$res eq $expected or die "FAIL: $cmd\nEXPECTED:\n$expected\nACTUAL:\n$res";
|
||||
my $exp = do {
|
||||
local $/ = undef;
|
||||
open my $fh, "<", "t/" . $expected
|
||||
or die "error opening file: $!";
|
||||
<$fh>
|
||||
};
|
||||
|
||||
$res eq $exp or die "FAIL: $cmd\nEXPECTED:\n$exp\nACTUAL:\n$res";
|
||||
}
|
||||
|
||||
# TODO: testing format
|
||||
test("./cap2site.pod", "hello.gmi", <<'EOF');
|
||||
<h1>Hello, world!</h1>
|
||||
<p>Lorem ipsum dolor sit amet</p>
|
||||
EOF
|
||||
|
||||
test("./cap2site.pod -s", "hello.gmi", <<'EOF');
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" href="style.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello, world!</h1>
|
||||
<p>Lorem ipsum dolor sit amet</p>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
test("./cap2site.pod", "hello.gmi", "hello_exp.html");
|
||||
test("./cap2site.pod -s", "hello.gmi", "hello_standalone_exp.html");
|
||||
|
||||
say "DONE!";
|
||||
|
|
Loading…
Reference in New Issue