Content deleted Content added
use simpler linking function |
avoid ending author citation in a space, hyphen, or apostrophe |
||
Line 34:
pos = advance_pos_if_starts_with(str, "%.? ?f?%.?", pos)
local last_char = mw.ustring.sub(str, pos - 1, pos - 1)
if last_char == " " or last_char == "-" or last_char == "'" then
pos = pos - 1
end
if pos and (not j or pos <= j) then
return pos - 1
end
end
Line 76 ⟶ 81:
citation,
function (author)
mw.log(author)
if author_abbrevs[author] then
return "[[" .. author_abbrevs[author] .. "|" .. author .. "]]"
|