Hi, I am very new to Lua but I do have two tiny Pandoc Lua filters that work. They are extremely similar and I would like to combine them. I'm just not sure how to introduce the conditional aspect.
1. This script simply exchanges the '.md' file extension for the '.html' extension:
function Link (link)
link.target = link.target:gsub('(.+)%.md', '%1.html')
return link
end
2. This script does the same except it handles the case where the link contains an anchor:
function Link (link)
link.target = link.target:gsub('(.+)%.md%#(.+)', '%1.html#%2')
return link
end
/pm