Browse Source

Odstraněny zbytky passování atributů manuálně, někde úmyslně zanecháno. Resolves #26

citace
Jan Černohorský 10 months ago
parent
commit
b0f4ad71d0
  1. 8
      src/formatitko/transform_processor.py

8
src/formatitko/transform_processor.py

@ -341,11 +341,7 @@ class TransformProcessor:
def transform_Image(self, e: Image) -> Image:
e.content = self.transform(e.content)
# FIXME? Passing down attributes explicitly no longer needed, because OG now has access to Context.
# Pass down the directory of the current source file for finding image
# files.
e.attributes["source_dir"] = self.context.dir
# FIXME? Passing down attributes explicitly no longer needed, because OG now has access to Context.
# OG now has Context so this is not needed per se, but I'm keeping this here for the handling of attribute > context > default value
# Pass down "no-srcset" metadatum as attribute down to images.
if not "no-srcset" in e.attributes:
e.attributes["no-srcset"] = self.context.get_metadata("no-srcset") if self.context.get_metadata("no-srcset") is not None else False
@ -470,7 +466,7 @@ class TransformProcessor:
# Pass down metadata 'highlight' and 'highlight_style' as attribute to CodeBlocks
# FIXME? Passing down attributes explicitly no longer needed, because OG now has access to Context.
# OG now has Context so this is not needed per se, but I'm keeping this here for the handling of attribute > context > default value
if not "highlight" in e.attributes:
e.attributes["highlight"] = self.context.get_metadata("highlight") if self.context.get_metadata("highlight") is not None else True
if not "style" in e.attributes:

Loading…
Cancel
Save