diff --git a/canonicalwebteam/discourse/parsers/base_parser.py b/canonicalwebteam/discourse/parsers/base_parser.py index 1cd1dca..c6176bf 100644 --- a/canonicalwebteam/discourse/parsers/base_parser.py +++ b/canonicalwebteam/discourse/parsers/base_parser.py @@ -610,6 +610,9 @@ def _replace_image_src(self, soup): Given some HTML soup, replace relative image srcs """ for img in soup.findAll("img"): + src = img.get("src", "") + if src and src.startswith("/") and not src.startswith("//"): + img["src"] = f"{self.api.base_url}{src}" if img.get("srcset", None): del img["srcset"] diff --git a/setup.py b/setup.py index 73e495d..32a95f5 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name="canonicalwebteam.discourse", - version="5.4.8", + version="5.4.9", author="Canonical webteam", author_email="webteam@canonical.com", url="https://github.com/canonical/canonicalwebteam.discourse",