File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -357,12 +357,15 @@ def run(self) -> List[nodes.Element]:
357357 # i.e. relative to source directory
358358 try :
359359 sphinx_env = self .document .settings .env
360- _ , include_arg = sphinx_env .relfn2path (self .arguments [0 ])
361- sphinx_env .note_included (include_arg )
362360 except AttributeError :
363361 pass
362+ else :
363+ _ , include_arg = sphinx_env .relfn2path (self .arguments [0 ])
364+ sphinx_env .note_included (include_arg )
364365 path = Path (include_arg )
365366 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 ))
366369
367370 # read file
368371 encoding = self .options .get ("encoding" , self .document .settings .input_encoding )
You can’t perform that action at this time.
0 commit comments