Skip to content

Commit

Permalink
Add alternative matches for implicit extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewvincent committed May 19, 2022
1 parent 397d4a0 commit 0c305cb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lua/mkdnflow/links.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,11 @@ M.getLinkPart = function(part)
)
local anchor
local path_type = require('mkdnflow.paths').pathType(path)
if link_style == 'wiki' and path_type == 'filename' then
anchor = path:match('.*(#.*)')
if anchor then path = path:match('(.*)#') end
elseif path_type == 'filename' then
anchor = path:match('%.md(#.*)')
if anchor then path = path:match('(.*%.md)#') end
if path_type == 'filename' then
anchor = path:match('%.md(#.+)') or path:match('.+(#.+)')
if anchor then
path = path:match('(.+%.md)#') or path:match('(.+)#')
end
end
return path, anchor
end
Expand Down

0 comments on commit 0c305cb

Please sign in to comment.