Module:Quote

local p = {}

local userError = require('Dev:User error')

function replacer(tag, text) return table.concat({       '',        text,        ' '    }) end

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 quote, _ = mw.ustring.gsub(mw.text.trim(args[1]), '\n', ' ') quote, _ = mw.ustring.gsub(quote, '<(%w+)>([^<]+)', replacer) local html = mw.html.create('blockquote'):attr({       ['data-template'] = 'quote',        ['data-font']     = args[3]    }) :tag('p') :wikitext(quote) :done if args[2] then html:tag('cite') :wikitext(args[2]) :done end return tostring(html:done) end

return p