Fix handlování cest obrázků, když jsou namespacové.
This commit is contained in:
parent
caef60d472
commit
5c066d46af
3 changed files with 5 additions and 0 deletions
|
@ -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:]
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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:]
|
||||
|
|
Loading…
Reference in a new issue