mirror of
https://github.com/flextype/flextype.git
synced 2025-08-23 05:16:03 +02:00
feat(core): add trim for FrontmatterParser content #186
This commit is contained in:
@@ -33,10 +33,10 @@ class FrontmatterParser
|
||||
{
|
||||
$parts = preg_split('/^[\s\r\n]?---[\s\r\n]?$/sm', PHP_EOL . ltrim($content));
|
||||
if (count($parts) < 3) {
|
||||
return ['content' => $content];
|
||||
return ['content' => trim($content)];
|
||||
}
|
||||
|
||||
return YamlParser::decode(trim($parts[1])) + ['content' => implode(PHP_EOL . '---' . PHP_EOL, array_slice($parts, 2))];
|
||||
return YamlParser::decode(trim($parts[1])) + ['content' => trim(implode(PHP_EOL . '---' . PHP_EOL, array_slice($parts, 2)))];
|
||||
}
|
||||
|
||||
public static function encode($input) : string
|
||||
|
Reference in New Issue
Block a user