Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hydephp/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jun 13, 2024
2 parents 48ad903 + f985751 commit 0f2a4f0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/framework/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"illuminate/view": "^10.0",
"symfony/yaml": "^6.0",
"league/commonmark": "^2.2",
"spatie/yaml-front-matter": "^2.0.7",
"spatie/yaml-front-matter": "^2.0.9",
"torchlight/torchlight-commonmark": "^0.5.5"
},
"suggest": {
Expand Down
15 changes: 15 additions & 0 deletions packages/framework/tests/Feature/MarkdownFileParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,19 @@ public function testParsedMarkdownPostContainsValidFrontMatter()
$this->assertSame('Mr. Hyde', $post->matter('author'));
$this->assertSame('blog', $post->matter('category'));
}

public function testCanParseMarkdownFileWithFrontMatterAndNoMarkdownBody()
{
file_put_contents(Hyde::path('_posts/test-post.md'), "---\nfoo: bar\n---");

$document = MarkdownFileParser::parse('_posts/test-post.md');

$this->assertInstanceOf(MarkdownDocument::class, $document);
$this->assertEquals('', $document->markdown);
$this->assertSame('', $document->markdown->body());

$this->assertEquals(FrontMatter::fromArray([
'foo' => 'bar',
]), $document->matter);
}
}

0 comments on commit 0f2a4f0

Please sign in to comment.