From e1f43095ea90e92bed491ab53b502d12e5bd552f Mon Sep 17 00:00:00 2001 From: zyppe <210hcl@gmail.com> Date: Sat, 1 Mar 2025 19:55:07 +0800 Subject: [PATCH] Add condition for common markdown. --- Translator/read.pl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Translator/read.pl b/Translator/read.pl index 594a581..d9e453f 100644 --- a/Translator/read.pl +++ b/Translator/read.pl @@ -46,13 +46,18 @@ for my $d (@data) { my %info; my $content; open my $file, "< :encoding(UTF-8)", $d; - <$file>; - while (<$file>) { - chomp; - if (/^([^:]+):\s+(.+)/) { - $info{$1} = $2; + my $line = <$file>; + if ( $line eq '---' ) { + while (<$file>) { + chomp; + if (/^([^:]+):\s+(.+)/) { + $info{$1} = $2; + } + last if /---/; } - last if /---/; + } + else { + $content = $line; } while (<$file>) { $content .= $_;