Modul:Excerpt: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
Sophivorus (bicara | kontrib) Tidak ada ringkasan suntingan |
Sophivorus (bicara | kontrib) Tidak ada ringkasan suntingan |
||
Baris 52:
local section = fragment or getArg(2, getArg('section', mw.ustring.match(getArg(1), '[^#]+#([^#]+)') ) )
local hat = yesno( getArg('hat', true) )
local edit = yesno( getArg('edit', true) )
local this = getArg('this')
local only = getArg('only')
local files = getArg('files', getArg('file', ( only == 'file' and 1 ) ) )
local lists = getArg('lists', getArg('list', ( only == 'list' and 1 ) ) )
local tables = getArg('tables', getArg('table', ( only == 'table' and 1 ) ) )
local templates = getArg('templates', getArg('template', ( only == 'template' and 1 ) ) )
local paragraphs = getArg('paragraphs', getArg('paragraph', ( only == 'paragraph' and 1 ) ) )▼
local references = getArg('references', getArg('reference', ( only == 'reference' and 1 ) ) )▼
local sections = not yesno( getArg('sections') )
local templates = table.concat((config.templates or {}), ',')▼
▲ local paragraphs = getArg('paragraphs')
▲ local references = getArg('references')
local noBold = not yesno( getArg('bold') )
local inline = yesno( getArg('inline') )
Baris 66 ⟶ 67:
local more = yesno( getArg('more') )
local class = getArg('class')
-- Build the hatnote
Baris 80 ⟶ 82:
hat = hat .. ' ' .. getMessage('excerpt') .. ' '
if section and not fragment then
hat = hat .. '[[:' .. page .. '#' .. mw.uri.anchorEncode(section) .. '|' .. page
.. ' § ' .. mw.ustring.gsub(section, '%[%[([^]|]+)|?[^]]*%]%]', '%1') .. ']]' -- remove nested links
else
hat = hat .. '[[:' .. page .. '|' .. page .. ']]'
end
hat = hat .. "''" .. '<span class="mw-editsection-like plainlinks"><span class="mw-editsection-bracket">[</span>['▼
hat = hat ..
hat = hat .. title:fullUrl('action=edit') .. ' ' .. mw.message.new('editsection'):plain()
▲ hat = hat
end
▲ if ok then
if config.hat then
hat = config.hat .. hat .. '}}'
hat = frame:preprocess(hat)
hat = mw.html.create('div'):addClass('dablink excerpt-hat'):wikitext(hat)▼
end
else
hat = nil
Baris 112 ⟶ 115:
tables = tables,
paragraphs = paragraphs,
templates = templates
sections = sections,
categories = 0,
Baris 138 ⟶ 141:
-- If no file was found, try to excerpt one from the removed infoboxes
local fileNamespaces = Transcluder.getNamespaces('File')
if not only and (files ~= '0' or not files) and not Transcluder.matchAny(excerpt, '%[%[', fileNamespaces, ':') and config.captions then
local templates = Transcluder.get(title, { only = 'templates', templates =
local parameters = Transcluder.getParameters(templates)
local file, captions, caption
Baris 152 ⟶ 155:
end
excerpt = '[[File:' .. file .. '|thumb|' .. (caption or '') .. ']]' .. excerpt
excerpt = Transcluder.removeNonFreeFiles(excerpt)
break
end
|