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,7 +46,8 @@ 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>;
if ( $line eq '---' ) {
while (<$file>) { while (<$file>) {
chomp; chomp;
if (/^([^:]+):\s+(.+)/) { if (/^([^:]+):\s+(.+)/) {
@ -54,6 +55,10 @@ for my $d (@data) {
} }
last if /---/; last if /---/;
} }
}
else {
$content = $line;
}
while (<$file>) { while (<$file>) {
$content .= $_; $content .= $_;
} }