From bf08cee57a90dfd5d59b44908ef13ce2f354f8a2 Mon Sep 17 00:00:00 2001 From: VitjanZ Date: Thu, 18 Jun 2026 12:27:33 +0200 Subject: [PATCH] Rejecting .plain linked resources. --- plain_file.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plain_file.py b/plain_file.py index 4f7c28f..c116d33 100644 --- a/plain_file.py +++ b/plain_file.py @@ -100,6 +100,14 @@ def check_section_for_linked_resources(section): if len(link.node.children) != 1: raise PlainSyntaxError(f"Plain syntax error: Link must have text specified (link: {link.node.target}).") + linked_resource_file_extension = os.path.splitext(os.path.basename(link.node.target))[1] + if linked_resource_file_extension == ".plain": + raise PlainSyntaxError( + f"Referenced resource '{link.node.target}' is a .plain file. " + f"Referencing .plain files through Linked Resources is not supported. " + "Please use the import section to include definitions or implementation/test requirements from another module." + ) + linked_resources.append({"text": link.node.children[0].content, "target": link.node.target}) if linked_resources: