diff --git a/lua/nvim-devdocs/transpiler.lua b/lua/nvim-devdocs/transpiler.lua index b5d04e8..25d98c7 100644 --- a/lua/nvim-devdocs/transpiler.lua +++ b/lua/nvim-devdocs/transpiler.lua @@ -289,7 +289,7 @@ function transpiler:eval(node) if tag_name == "a" then result = string.format("[%s](%s)", result, attributes.href) - elseif tag_name == "img" and string.match(attributes.src, "^data:") then + elseif tag_name == "img" and string.match(attributes.src or "", "^data:") then result = string.format("![%s](%s)\n", attributes.alt, "data:inline_image") elseif tag_name == "img" then result = string.format("![%s](%s)\n", attributes.alt, attributes.src)