Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit 0e08b85

Browse files
Merge pull request #44 from emmanueltouzery/inline_images
transpiler: special handling for inline images
2 parents 57074bc + 289cf1a commit 0e08b85

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lua/nvim-devdocs/transpiler.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ function transpiler:eval(node)
211211

212212
if tag_name == "a" then
213213
result = string.format("[%s](%s)", result, attributes.href)
214+
elseif tag_name == "img" and string.match(attributes.src, "^data:") then
215+
result = string.format("![%s](%s)", attributes.alt, "data:inline_image")
214216
elseif tag_name == "img" then
215217
result = string.format("![%s](%s)", attributes.alt, attributes.src)
216218
elseif tag_name == "pre" and attributes["data-language"] then

0 commit comments

Comments
 (0)