Module:Citation
Documentation for this module may be created at Module:Citation/doc
local p = {}
function p.comment_on(title, url) -- formats the 'comment on' bit depending on if a url, title or both are provided
if not title or url then
return false; -- if comment fields aren't filled, no need to continue
end
if title and url then -- there are probably less redundant ways to form the text than this but it gets the job done
return string.format("'Comment on \"[%s %s]\"'", url, title)
elseif title then
return string.format("'Comment on \"%s\"'", title)
elseif url then
return string.format("'Comment on %s'", url)
end
end
return p