From d783c7ae9cf0a2826e5f21d090b56730ed496045 Mon Sep 17 00:00:00 2001 From: Jiri Kalvoda Date: Sun, 17 Mar 2024 22:32:00 +0100 Subject: [PATCH] context: current_figure --- src/formatitko/transform_processor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/formatitko/transform_processor.py b/src/formatitko/transform_processor.py index d96915f..5451fc7 100644 --- a/src/formatitko/transform_processor.py +++ b/src/formatitko/transform_processor.py @@ -326,7 +326,10 @@ class TransformProcessor(NOPProcessor): else: e.attributes["number"] = self.context.get_data("figure_number_generator")(e, self.context) self.context.get_data("obj_map")[e.identifier] = e - return super().transform_Figure(e) + self.context.set_data("current_figure", e) + r = super().transform_Figure(e) + self.context.unset_data("current_figure") + return r def transform_Link(self, e: Link) -> Link: e = FLink(*e.content, url=e.url, identifier=e.identifier, attributes=e.attributes, classes=e.classes, obj_map=self.context.get_data("obj_map"))