Skip to content

Commit 5e4158b

Browse files
committed
test(pandoc-partition): cover a fence closed by an indented marker
Distinct from the indented-open case already covered: opening fence at column 0, closing marker indented, followed by a real heading. Confirms the indented fence-close fix also resolves the case where a heading after such a fence would otherwise never be reached.
1 parent 2d928e4 commit 5e4158b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/unit/pandoc-partition.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,21 @@ unitTest(
161161
},
162162
);
163163

164+
// deno-lint-ignore require-await
165+
unitTest(
166+
"markdownWithExtractedHeading - closes a fence whose closing marker is indented, then extracts the following heading",
167+
async () => {
168+
const markdown = [
169+
"```python",
170+
"code",
171+
" ```",
172+
"# Real Heading",
173+
].join("\n");
174+
const result = markdownWithExtractedHeading(markdown);
175+
assertEquals(result.headingText, "Real Heading");
176+
},
177+
);
178+
164179
// deno-lint-ignore require-await
165180
unitTest(
166181
"markdownWithExtractedHeading - extracts a setext-style heading",

0 commit comments

Comments
 (0)