implement markdown.image_labels config option
This commit is contained in:
parent
0940472410
commit
22a0a39d81
2 changed files with 4 additions and 1 deletions
|
@ -54,7 +54,7 @@ class ZonaConfig:
|
||||||
# list of globs relative to content that should be ignored
|
# list of globs relative to content that should be ignored
|
||||||
ignore: list[str] = field(default_factory=lambda: IGNORELIST)
|
ignore: list[str] = field(default_factory=lambda: IGNORELIST)
|
||||||
markdown: MarkdownConfig = field(default_factory=MarkdownConfig)
|
markdown: MarkdownConfig = field(default_factory=MarkdownConfig)
|
||||||
build: BuildConfig = field(default_factory=BuildConfig)
|
# build: BuildConfig = field(default_factory=BuildConfig)
|
||||||
blog: BlogConfig = field(default_factory=BlogConfig)
|
blog: BlogConfig = field(default_factory=BlogConfig)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -72,6 +72,9 @@ class ZonaRenderer(HTMLRenderer):
|
||||||
# TODO: image compression/dithering?
|
# TODO: image compression/dithering?
|
||||||
@override
|
@override
|
||||||
def render_image(self, element: Image):
|
def render_image(self, element: Image):
|
||||||
|
assert self.config
|
||||||
|
if not self.config.markdown.image_labels:
|
||||||
|
return super().render_image(element)
|
||||||
# get label text from children
|
# get label text from children
|
||||||
text = self.render_children(element)
|
text = self.render_children(element)
|
||||||
title = element.title or ""
|
title = element.title or ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue