Fandom

Infobox Wikia

Module:Quote2

225pages on
this wiki
Add New Page
Talk0
--<pre>
-- Based on Module:Quote (from dev.wikia.com?)
-- Changes:
--   - Use opposing curly double quote entities instead of the same as characters.
--   - Italicize personquoted and quotesource.
--   - Support changing text-align of quote (mostly just for center).
--   - Support changing quote font-size.
local Quote = {}
local getArgs = require('Module:Arguments').getArgs
 
function Quote.quote(frame) -- Implements {{Quote}}
	local args = getArgs(frame)
	return Quote._quote(args)
end
 
Quote.main = Quote.quote
 
function Quote._quote( args )
    local quotetext = args['quote'] or args[1] or args['quotetext'] or ''
    local personquoted = args['person'] or args[2] or args['personquoted']
    local quotesource = args[3] or args['quotesource']
    local quotealign = args[4] or args['quotealign']
    local quotesize = args[5] or args['quotesize']
    local reference = mw.html.create('cite')
            :addClass("ref_author")
 
    if (not quotealign) then
        quotealign = 'inherit'
    end
    if (not quotesize) then
        quotesize = 'inherit'
    end
 
    local blockquote = mw.html.create('blockquote')
            :wikitext('<span style="font-size:' .. quotesize .. ';">&ldquo; ' .. quotetext .. ' &rdquo;</span>')
            :addClass("ref_quote")
            :cssText('text-align:' .. quotealign .. ';')
 
    if (personquoted or quotesource) then 
        local source = '&mdash; <i>'.. (personquoted or quotesource) .. '</i>'
 
        if (personquoted and quotesource) then 
            source = '&mdash; <i>' .. personquoted .. ', ' .. quotesource.. '</i>'
        end
 
        reference:wikitext(source)
        blockquote:node(reference)
    end
 
    return tostring(blockquote)
end
 
function Quote.line( frame )
-- implements {{Line}}
 
end
 
function Quote.dialogue( frame )
-- implements {{Dialogue}}
end
 
return Quote

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.