Add condition for common markdown.

This commit is contained in:
zyppe 2025-03-01 19:55:07 +08:00
parent 80e3c8cc3a
commit e1f43095ea

View file

@ -46,13 +46,18 @@ for my $d (@data) {
my %info; my %info;
my $content; my $content;
open my $file, "< :encoding(UTF-8)", $d; open my $file, "< :encoding(UTF-8)", $d;
<$file>; my $line = <$file>;
while (<$file>) { if ( $line eq '---' ) {
chomp; while (<$file>) {
if (/^([^:]+):\s+(.+)/) { chomp;
$info{$1} = $2; if (/^([^:]+):\s+(.+)/) {
$info{$1} = $2;
}
last if /---/;
} }
last if /---/; }
else {
$content = $line;
} }
while (<$file>) { while (<$file>) {
$content .= $_; $content .= $_;