diff --git a/ChangeLog.md b/ChangeLog.md index d17f800..210b0b6 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ # Release Notes +## [0.2.2] - 2024-11-26 + +- Fix: prevent calling method `report_messages` if `HTML5Translator` does not have it. It is here for compat reasons. + ## [0.2.1] - 2024-11-26 - Fix: destination directory was not properly referred to when copying images. diff --git a/package.json b/package.json index 3a317e8..69dd586 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sphinx-colorschemed-images", - "version": "0.2.1", + "version": "0.2.2", "description": "Include color-scheme aware images in Sphinx projects.", "repository": { "type": "git", diff --git a/sphinx_colorschemed_images/__init__.py b/sphinx_colorschemed_images/__init__.py index ec5fc69..6a89d61 100644 --- a/sphinx_colorschemed_images/__init__.py +++ b/sphinx_colorschemed_images/__init__.py @@ -2,7 +2,7 @@ from .extension import copy_colorschemed_images, extension_builder_inited -__version__ = "0.2.1" +__version__ = "0.2.2" def setup(app) -> dict: diff --git a/sphinx_colorschemed_images/translator.py b/sphinx_colorschemed_images/translator.py index 6f3dfac..37660e0 100644 --- a/sphinx_colorschemed_images/translator.py +++ b/sphinx_colorschemed_images/translator.py @@ -245,7 +245,7 @@ def CS_visit_image(node): atts["alt"] = alt element = self.emptytag(node, "img", suffix, src=uri, **atts) self.body.append(element) - if suffix: # block-element + if suffix and getattr(self, "report_messages", None): # block-element self.report_messages(node) # -----------------------------------------------------