Revision 8c453ec29bd697143c633a3fdda74b279445b180 authored by dannephoto on 18 July 2017, 09:48:56 UTC, committed by dannephoto on 18 July 2017, 09:48:56 UTC
1 parent 1072f23
showlink.lua
function ShowLink(addr, name)
newname = name
if string.find(addr, "Video") then
return -- don't show videos
elseif string.find(addr, "Image") then
return -- don't show sample images
elseif string.find(addr, "magiclantern.wikia.com") and not string.find(name, "here") then
name = string.gsub(name, [[#]], [[\#]])
newname = "" .. name
elseif not string.find(addr, "amzn") and not string.find(addr, "sescom") then
-- escape TeX special characters and strip HTTP
local a = addr
a = string.gsub(a, [[http://]], [[]])
a = string.gsub(a, [[https://]], [[]])
a = string.gsub(a, [[&]], [[\&]])
a = string.gsub(a, [[_]], [[\_]])
a = string.gsub(a, [[#]], [[\#]])
a = string.gsub(a, [[%%]], [[\%%]])
a = string.gsub(a, [[/]], [[/\phantom{-}\hskip-1ex]])
newname = newname .. [[{ \scriptsize \textlangle ]] .. a .. [[\textrangle }]]
end
tex.print([[\oldhref{]] .. addr .. [[}{]] .. newname .. [[}]])
end
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...