mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-04 19:07:40 +00:00
examples: Handle newlines in README.txt better.
This commit is contained in:
parent
0f228de48a
commit
47429227ab
1 changed files with 8 additions and 2 deletions
|
@ -167,18 +167,24 @@ sub handle_example_dir {
|
||||||
my $onmouseoverdst = "$dst/$onmouseoverfname";
|
my $onmouseoverdst = "$dst/$onmouseoverfname";
|
||||||
|
|
||||||
my $description = '';
|
my $description = '';
|
||||||
|
my $has_paragraph = 0;
|
||||||
if (open(my $readmetxth, '<', "$examples_dir/$category/$example/README.txt")) {
|
if (open(my $readmetxth, '<', "$examples_dir/$category/$example/README.txt")) {
|
||||||
while (<$readmetxth>) {
|
while (<$readmetxth>) {
|
||||||
chomp;
|
chomp;
|
||||||
s/\A\s+//;
|
s/\A\s+//;
|
||||||
s/\s+\Z//;
|
s/\s+\Z//;
|
||||||
if ($_ eq '') {
|
if (($_ eq '') && ($description ne '')) {
|
||||||
$description .= "\n<br/>\n<br/>\n";
|
$has_paragraph = 1;
|
||||||
} else {
|
} else {
|
||||||
|
if ($has_paragraph) {
|
||||||
|
$description .= "\n<br/>\n<br/>\n";
|
||||||
|
$has_paragraph = 0;
|
||||||
|
}
|
||||||
$description .= "$_ ";
|
$description .= "$_ ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close($readmetxth);
|
close($readmetxth);
|
||||||
|
$description =~ s/\s+\Z//;
|
||||||
}
|
}
|
||||||
|
|
||||||
do_mkdir($dst);
|
do_mkdir($dst);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue