Skip to content

Commit 65afc73

Browse files
committed
Add tests for #1337
1 parent 705c3a7 commit 65afc73

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php

+63
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,67 @@ public function test_can_compile_page_to_root_output_directory()
7070
'<p>So she was considering in her own mind, as well as she could',
7171
], '_site/test-page.html');
7272
}
73+
74+
public function test_can_compile_page_with_atx_headers()
75+
{
76+
$this->page = DocumentationPage::make('test-page', markdown: <<<'MARKDOWN'
77+
# Adventures in Wonderland
78+
79+
## CHAPTER I. DOWN THE RABBIT-HOLE.
80+
81+
So she was considering in her own mind, as well as she could, for the hot day made her feel very sleepy and stupid.
82+
83+
MARKDOWN
84+
);
85+
86+
$this->inspectHtml([
87+
'Adventures in Wonderland',
88+
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" aria-hidden="true" title="Permalink">#</a></h2>',
89+
'<p>So she was considering in her own mind, as well as she could',
90+
]);
91+
}
92+
93+
public function test_can_compile_page_with_setext_headers()
94+
{
95+
$this->page = DocumentationPage::make('test-page', markdown: <<<'MARKDOWN'
96+
Adventures in Wonderland
97+
========================
98+
99+
CHAPTER I. DOWN THE RABBIT-HOLE.
100+
-------------------------------
101+
102+
So she was considering in her own mind, as well as she could, for the hot day made her feel very sleepy and stupid.
103+
104+
MARKDOWN
105+
);
106+
107+
$this->inspectHtml([
108+
'Adventures in Wonderland',
109+
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" aria-hidden="true" title="Permalink">#</a></h2>',
110+
'<p>So she was considering in her own mind, as well as she could',
111+
]);
112+
}
113+
114+
public function test_can_compile_page_to_root_output_directory_with_setext_headers()
115+
{
116+
DocumentationPage::setOutputDirectory('');
117+
118+
$this->page = DocumentationPage::make('test-page', markdown: <<<'MARKDOWN'
119+
Adventures in Wonderland
120+
========================
121+
122+
CHAPTER I. DOWN THE RABBIT-HOLE.
123+
-------------------------------
124+
125+
So she was considering in her own mind, as well as she could, for the hot day made her feel very sleepy and stupid.
126+
127+
MARKDOWN
128+
);
129+
130+
$this->inspectHtml([
131+
'Adventures in Wonderland',
132+
'<h2>CHAPTER I. DOWN THE RABBIT-HOLE.<a id="chapter-i-down-the-rabbit-hole" href="#chapter-i-down-the-rabbit-hole" class="heading-permalink" aria-hidden="true" title="Permalink">#</a></h2>',
133+
'<p>So she was considering in her own mind, as well as she could',
134+
], '_site/test-page.html');
135+
}
73136
}

0 commit comments

Comments
 (0)