We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c8aebe commit dad95eeCopy full SHA for dad95ee
1 file changed
myst_parser/mocking.py
@@ -357,12 +357,15 @@ def run(self) -> List[nodes.Element]:
357
# i.e. relative to source directory
358
try:
359
sphinx_env = self.document.settings.env
360
- _, include_arg = sphinx_env.relfn2path(self.arguments[0])
361
- sphinx_env.note_included(include_arg)
362
except AttributeError:
363
pass
+ else:
+ _, include_arg = sphinx_env.relfn2path(self.arguments[0])
364
+ sphinx_env.note_included(include_arg)
365
path = Path(include_arg)
366
path = source_dir.joinpath(path)
367
+ # this ensures that the parent file is rebuilt if the included file changes
368
+ self.document.settings.record_dependencies.add(str(path))
369
370
# read file
371
encoding = self.options.get("encoding", self.document.settings.input_encoding)
0 commit comments