Skip to content

Commit 18aefde

Browse files
committed
fix: use non-NUL separator in mermaid_cache_path
The NUL byte separator in mermaid_cache_path causes the Lua→vimscript bridge to convert the concatenated string to a Blob on Neovim ≤ 0.11, which vim.fn.sha256 rejects with E976. Using '|' avoids the Blob conversion entirely. Fixed upstream in v0.12 (vim-patch 9.1.1774).
1 parent 9874f13 commit 18aefde

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/md-render/image.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ end
407407
---@return string
408408
local function mermaid_cache_path(source)
409409
local theme, bg_hex = mermaid_theme_args()
410-
local hash = vim.fn.sha256(source .. "\0" .. theme .. "\0" .. bg_hex):sub(1, 16)
410+
local hash = vim.fn.sha256(source .. "|" .. theme .. "|" .. bg_hex):sub(1, 16)
411411
return get_mermaid_cache_dir() .. "/" .. hash .. ".png"
412412
end
413413

0 commit comments

Comments
 (0)