doc: link-roles: Update path handling to use document name

Use docname instead of source from get_source_and_line() because
source can be a relative path to an included file (e.g., .rst.inc),
while docname is always the main document being processed.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé
2026-01-20 23:07:22 +01:00
committed by Anas Nashif
parent 608fdac2d7
commit 474d502df3

View File

@@ -119,7 +119,8 @@ def modulelink(default_module=None, format="blob"):
)
if module == config.link_roles_manifest_project:
p = Path(source).relative_to(inliner.document.settings.env.srcdir)
docname = inliner.document.settings.env.docname
p = Path(docname)
if (
not any(
p.match(glob)