File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
packages/framework/tests/Unit Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -108,4 +108,30 @@ public function testCarriageReturnsAreNormalized()
108108 $ markdown = new Markdown ("foo \nbar " );
109109 $ this ->assertSame ("foo \nbar " , $ markdown ->body ());
110110 }
111+
112+ public function testRender (): void
113+ {
114+ $ html = Markdown::render ('# Hello World! ' );
115+
116+ $ this ->assertIsString ($ html );
117+ $ this ->assertSame ("<h1>Hello World!</h1> \n" , $ html );
118+ }
119+
120+ public function testRenderWithCustomHydeMarkdownFeatures ()
121+ {
122+ $ html = Markdown::render (<<<'MARKDOWN'
123+ # Hello World
124+
125+ >info Colored blockquote
126+
127+ [Home](/_pages/index.blade.php)
128+ MARKDOWN);
129+
130+ $ this ->assertSame (<<<'HTML'
131+ <h1>Hello World</h1>
132+ <blockquote class="info"><p>Colored blockquote</p></blockquote>
133+ <p><a href="index.html">Home</a></p>
134+
135+ HTML, $ html );
136+ }
111137}
You can’t perform that action at this time.
0 commit comments