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

Commit 0416494

Browse files
fix: build & empty doc entries
Fixed build error and empty doc entries when the pattern is not found.
1 parent 73becaf commit 0416494

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lua/nvim-devdocs/operations.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ M.filter_doc = function(lines, pattern)
203203
if found then table.insert(filtered_lines, line) end
204204
end
205205

206+
if not found then return lines end
207+
206208
return filtered_lines
207209
end
208210

lua/nvim-devdocs/transpiler.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ function transpiler:eval(node)
277277
result = "\n```" .. attributes["data-language"] .. "\n" .. result .. "\n```\n"
278278
elseif tag_name == "pre" and attributes["class"] then
279279
local language = attributes["class"]:match("language%-(.+)")
280-
result = "\n```" .. language .. "\n" .. result .. "\n```\n"
280+
result = "\n```" .. (language or "") .. "\n" .. result .. "\n```\n"
281281
elseif tag_name == "abbr" then
282282
result = string.format("%s(%s)", result, attributes.title)
283283
elseif tag_name == "iframe" then

0 commit comments

Comments
 (0)