From 8afb787c98598b1ce81aaa55a2645d3df53b4107 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 11 Dec 2024 20:51:08 +0100 Subject: [PATCH] fix: only change prefix if path is relative --- src/rougail/annotator/family.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rougail/annotator/family.py b/src/rougail/annotator/family.py index 049a46e66..fd0cd3be8 100644 --- a/src/rougail/annotator/family.py +++ b/src/rougail/annotator/family.py @@ -125,10 +125,12 @@ class Annotator(Walk): if family.type == "dynamic" and isinstance( family.dynamic, VariableCalculation ): - path = self.objectspace.paths.get_full_path( - family.dynamic.variable, - family.path, - ) + path = family.dynamic.variable + if family.version != "1.0" and self.objectspace.paths.regexp_relative.search(path): + path = self.objectspace.paths.get_full_path( + family.dynamic.variable, + family.path, + ) if family.version == '1.0' and "{{ suffix }}" in path: path = path.replace("{{ suffix }}", "{{ identifier }}") self.objectspace.informations.add(family.path, "dynamic_variable", path)