Skip to content

Commit 291194f

Browse files
🧪 TEST: add #1217's :start-after: include cases, expecting line 4
The two cases from #1217 (`:start-after:` alone, and with `:start-line:`), with the expectation corrected from `bad_after.md:5` to `:4`: the `:5` encoded the separate #1165 off-by-one, and the paragraph holding the role starts on line 4 of the file. Co-authored-by: vishalkaay <vishalr23@iitk.ac.in>
1 parent f5e1b94 commit 291194f

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎tests/test_renderers/fixtures/mock_include_errors.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,22 @@ Error line in nested include file:
6464
.
6565
tmpdir/bad_inner.md:3: (WARNING/2) Unknown interpreted text role "a". [myst.role_unknown]
6666
.
67+
68+
Error in include file with start-after:
69+
.
70+
```{include} bad_after.md
71+
:start-after: START-HERE
72+
```
73+
.
74+
tmpdir/bad_after.md:4: (WARNING/2) Unknown interpreted text role "a". [myst.role_unknown]
75+
.
76+
77+
Error in include file with start-line and start-after:
78+
.
79+
```{include} bad_after.md
80+
:start-line: 1
81+
:start-after: START-HERE
82+
```
83+
.
84+
tmpdir/bad_after.md:4: (WARNING/2) Unknown interpreted text role "a". [myst.role_unknown]
85+
.

‎tests/test_renderers/test_include_directive.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ def test_errors(file_params, tmp_path, monkeypatch):
5050
tmp_path.joinpath("bad_outer.md").write_text(
5151
"outer line\n\n```{include} bad_inner.md\n```\n"
5252
)
53+
tmp_path.joinpath("bad_after.md").write_text(
54+
"line one\nline two\nSTART-HERE\nline four\n{a}`b`"
55+
)
5356

5457
report_stream = StringIO()
5558
publish_doctree(

0 commit comments

Comments
 (0)