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

Commit

Permalink
fix: empty src attribute (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckasRanarison committed Apr 8, 2024
1 parent 26463f0 commit a541e8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/nvim-devdocs/transpiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a541e8c

Please sign in to comment.