mirror of
https://github.com/flextype/flextype.git
synced 2025-08-12 16:14:16 +02:00
feat(support): Simplify parsers and serializers #438
This commit is contained in:
@@ -82,10 +82,10 @@ class Frontmatter
|
||||
if (isset($input['content'])) {
|
||||
$content = $input['content'];
|
||||
array_delete($input, 'content');
|
||||
$matter = Yaml::encode($input);
|
||||
$matter = $this->flextype['yaml']->encode($input);
|
||||
} else {
|
||||
$content = '';
|
||||
$matter = Yaml::encode($input);
|
||||
$matter = $this->flextype['yaml']->encode($input);
|
||||
}
|
||||
|
||||
$encoded = '---' . "\n" .
|
||||
@@ -106,6 +106,6 @@ class Frontmatter
|
||||
return ['content' => trim($input)];
|
||||
}
|
||||
|
||||
return Yaml::decode(trim($parts[1]), false) + ['content' => trim(implode(PHP_EOL . '---' . PHP_EOL, array_slice($parts, 2)))];
|
||||
return $this->flextype['yaml']->decode(trim($parts[1]), false) + ['content' => trim(implode(PHP_EOL . '---' . PHP_EOL, array_slice($parts, 2)))];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user