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
To avoid replacing ".md" in the middle of a link (as in "
www.md.com"), the "$" anchor is needed.
link.target = link.target:gsub('^(.+)%.md$', '%1.html')
The combination of the two scripts may look like the following:
link.target = link.target:gsub('^(.+)%.md%f[%z#]', '%1.html')