mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
refact: file_extension
This commit is contained in:
@@ -15,6 +15,11 @@ function M.file_exists(fname)
|
||||
end
|
||||
end
|
||||
|
||||
-- Returns the file extension
|
||||
function M.get_extension(fname)
|
||||
return fname:match("^.+(%..+)$")
|
||||
end
|
||||
|
||||
-- Strips an extension from a file name, escaping "." properly, eg:
|
||||
-- strip_extension("path/Filename.md", ".md") -> "path/Filename"
|
||||
local function strip_extension(str, ext)
|
||||
|
||||
Reference in New Issue
Block a user