Add condition for common markdown.
This commit is contained in:
parent
80e3c8cc3a
commit
e1f43095ea
1 changed files with 11 additions and 6 deletions
|
@ -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 .= $_;
|
||||
|
|
Loading…
Add table
Reference in a new issue