Module:Quote

local p = {}

local userError = require('Dev:User error') local ZEROWIDTH = '&shy;'

function p.main(frame) local args = frame:getParent.args if not args[1] then return userError('No quotation text provided', 'Pages with user errors') end local str = {' ') table.insert(str, args[1]) if args[2] then local len1, len2 = #args[1], #args[2] / 2 if len2 > len1 then table.insert(str, ZEROWIDTH:rep(len2 - len1)) end end table.insert(str, ' ') if args[2] then table.insert(str, '— ') table.insert(str, args[2]) table.insert(str, ' ') end table.insert(str, ' ') end

return p