Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion myst_parser/mocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def run(self) -> list[nodes.Element]:
)
self.renderer.nested_render_text(
file_content,
startline + 1,
startline,
heading_offset=self.options.get("heading-offset", 0),
)
finally:
Expand Down
19 changes: 18 additions & 1 deletion tests/test_renderers/fixtures/mock_include_errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,22 @@ Error in include file:
```{include} bad.md
```
.
tmpdir/bad.md:2: (WARNING/2) Unknown interpreted text role "a". [myst.role_unknown]
tmpdir/bad.md:1: (WARNING/2) Unknown interpreted text role "a". [myst.role_unknown]
.

Error in include file with start line:
.
```{include} bad_start.md
:start-line: 1
```
.
tmpdir/bad_start.md:2: (WARNING/2) Unknown interpreted text role "a". [myst.role_unknown]
.

Error in nested include file:
.
```{include} outer.md
```
.
tmpdir/bad.md:1: (WARNING/2) Unknown interpreted text role "a". [myst.role_unknown]
.
2 changes: 2 additions & 0 deletions tests/test_renderers/test_include_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def test_errors(file_params, tmp_path, monkeypatch):
monkeypatch.chdir(tmp_path)

tmp_path.joinpath("bad.md").write_text("{a}`b`")
tmp_path.joinpath("bad_start.md").write_text("skip\n{a}`b`")
tmp_path.joinpath("outer.md").write_text("```{include} bad.md\n```")

report_stream = StringIO()
publish_doctree(
Expand Down