mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-04-25 11:32:56 +08:00
16 lines
402 B
Lua
16 lines
402 B
Lua
-- Copyright © Michal Čihař <michal@weblate.org>
|
|
--
|
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
function fix_link (url)
|
|
return url:sub(1,4) == "http" and url or "https://docs.weblate.org/en/latest/" .. url
|
|
end
|
|
function Link (link)
|
|
link.target = fix_link(link.target);
|
|
return link
|
|
end
|
|
function Image (img)
|
|
img.src = fix_link(img.src);
|
|
return src
|
|
end
|
|
return {{Link = Link, Image = Image}}
|