mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
fix(datasheet): broken images
This commit is contained in:
@@ -32,6 +32,10 @@ class ImagePathRewriterRenderer(MarkdownRenderer):
|
||||
url = token["attrs"]["url"]
|
||||
if "://" not in url and not url.startswith("/"):
|
||||
token["attrs"]["url"] = os.path.join(self.prefix, url)
|
||||
elif ".." in url:
|
||||
token["attrs"]["url"] = ""
|
||||
elif url.startswith("/"):
|
||||
token["attrs"]["url"] = os.path.join(self.prefix, "../" + url[1:])
|
||||
return super().image(token, state)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user