forked from docs/doc-exports
Fix img handling on subdirs
Reviewed-by: Kucerak, Kristian <kristian.kucerak@t-systems.com> Co-authored-by: gtema <artem.goncharov@gmail.com> Co-committed-by: gtema <artem.goncharov@gmail.com>
This commit is contained in:
parent
62b5636b2d
commit
035322711f
@ -139,7 +139,10 @@ class OTCDocConvertor:
|
||||
if img:
|
||||
# Store all referred images for copying
|
||||
self.doc_images.add(img["src"])
|
||||
img["src"] = "/_static/images/" + img["src"]
|
||||
img["src"] = (
|
||||
"/_static/images/"
|
||||
+ os.path.basename(img["src"])
|
||||
)
|
||||
del img["width"]
|
||||
del img["height"]
|
||||
del img["class"]
|
||||
@ -165,7 +168,7 @@ class OTCDocConvertor:
|
||||
for img in soup.body.find_all("img"):
|
||||
if img["src"] and not img["src"].startswith("/_static/images"):
|
||||
self.doc_images.add(img["src"])
|
||||
img["src"] = "/_static/images/" + img["src"]
|
||||
img["src"] = "/_static/images/" + os.path.basename(img["src"])
|
||||
del img["width"]
|
||||
del img["height"]
|
||||
del img["class"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user