context: current_figure

This commit is contained in:
Jiří Kalvoda 2024-03-17 22:32:00 +01:00
parent 71e5c5bbdc
commit d783c7ae9c

View file

@ -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"))