1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2025-02-22 10:12:47 +01:00

Merge pull request #26 from lxsang/master

fix local image rendering bug
This commit is contained in:
Xuan Sang LE 2020-10-01 11:19:53 +02:00 committed by GitHub
commit cd30af6da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,9 +14,8 @@ local pre_process_md = function(str, obj)
if apath then if apath then
apath = apath:gsub(" ", "%%%%20") apath = apath:gsub(" ", "%%%%20")
print(apath) print(apath)
content = str:gsub(pattern, content = content:gsub(pattern, "![](" .. HTTP_ROOT .. "/" ..
"![](" .. HTTP_ROOT .. "/" .. obj.name .. obj.name .. "/asset/" .. apath .. ")")
"/asset/" .. apath .. ")")
end end
end end
return content return content
@ -33,10 +32,10 @@ local post_process_md = function(str, obj)
if apath then if apath then
-- apath = utils.urlencode(apath):gsub("%%", "%%%%") -- apath = utils.urlencode(apath):gsub("%%", "%%%%")
apath = apath:gsub(" ", "%%20") apath = apath:gsub(" ", "%%20")
content = str:gsub(pattern, content = content:gsub(pattern,
"<model-viewer src=\"" .. HTTP_ROOT .. "/" .. "<model-viewer src=\"" .. HTTP_ROOT .. "/" ..
obj.name .. "/asset/" .. apath .. obj.name .. "/asset/" .. apath ..
"\" auto-rotate camera-controls></model-viewer>") "\" auto-rotate camera-controls></model-viewer>")
has_model = true has_model = true
end end
end end