diff --git a/src/formatitko/html_generator.py b/src/formatitko/html_generator.py
index 54002ce..46e54a4 100644
--- a/src/formatitko/html_generator.py
+++ b/src/formatitko/html_generator.py
@@ -143,6 +143,7 @@ class HTMLGenerator(OutputGenerator):
rel_dir = self.context.rel_dir
searcher = self.imageProcessor.get_searcher_by_path(url, rel_dir, source_dir)
+ url = self.imageProcessor.get_path_without_namespace(url)
_, ext = os.path.splitext(url)
ext = ext[1:]
diff --git a/src/formatitko/images.py b/src/formatitko/images.py
index 0f65b7b..93bc2bc 100644
--- a/src/formatitko/images.py
+++ b/src/formatitko/images.py
@@ -149,6 +149,9 @@ class ImageProcessor:
def get_namespace_by_path(self, path: str) -> ImageProcessorNamespace:
return self.namespaces[path.split(":")[0] if ":" in path else ""]
+ def get_path_without_namespace(self, path: str) -> str:
+ return ":".join(path.split(":")[1:])
+
def get_searcher_by_path(self, path: str, rel_dir: str, source_dir: str) -> ImageProcessorNamespaceSearcher:
return ImageProcessorNamespaceSearcher(self.get_namespace_by_path(path), rel_dir, source_dir)
diff --git a/src/formatitko/tex_generator.py b/src/formatitko/tex_generator.py
index 570478e..143e4a9 100644
--- a/src/formatitko/tex_generator.py
+++ b/src/formatitko/tex_generator.py
@@ -117,6 +117,7 @@ class UCWTexGenerator(OutputGenerator):
rel_dir = self.context.rel_dir
searcher = self.imageProcessor.get_searcher_by_path(url, rel_dir, source_dir)
+ url = self.imageProcessor.get_path_without_namespace(url)
_, ext = os.path.splitext(url)
ext = ext[1:]