8,290
edits
(add support for text prefix outside of link) |
mNo edit summary |
||
Line 27: | Line 27: | ||
if type == 'links' then | if type == 'links' then | ||
returnstrformat = function(linkprefix, word, linkpostfix) | returnstrformat = function(linkprefix, word, linkpostfix, indicator, textprefix) | ||
fronttext = '' | fronttext = '' | ||
if | if indicator ~= '' and string.sub(word, 1, string.len(indicator)) == indicator then | ||
word = string.sub(word, string.len( | word = string.sub(word, string.len(indicator) + 1) | ||
fronttext = textprefix | fronttext = textprefix | ||
end | end | ||
Line 36: | Line 36: | ||
end | end | ||
elseif type == 'templates' then | elseif type == 'templates' then | ||
returnstrformat = function(linkprefix, word, linkpostfix) | returnstrformat = function(linkprefix, word, linkpostfix, indicator, textprefix) | ||
return frame:expandTemplate{title = linkprefix, args={word, linkpostfix}} | return frame:expandTemplate{title = linkprefix, args={word, linkpostfix}} | ||
end | end | ||
Line 46: | Line 46: | ||
returnstr = returnstr .. replacer | returnstr = returnstr .. replacer | ||
end | end | ||
returnstr = returnstr .. returnstrformat(linkprefix, word, linkpostfix) | returnstr = returnstr .. returnstrformat(linkprefix, word, linkpostfix, textprefixindicator, textprefix) | ||
end | end | ||
return prefix .. returnstr .. postfix | return prefix .. returnstr .. postfix |