Content deleted Content added
Sophivorus (talk | contribs) Undid revision 953910898 by Sophivorus (talk) |
Use i18n for errors and excerpt() strings |
||
Line 553:
-- Main function returns a string value: text of the lead of a page
local function main(pageNames, options)
if not pageNames or #pageNames < 1 then return err("
local pageName
local text
Line 588:
end
if not normalisedPageName then
return err("
else
pageName = normalisedPageName
Line 605:
pageCount = pageCount - 1 -- ensure that we exit the loop after at most #pageNames iterations
end
if not text then return err("
text = cleanupText(text, options)
Line 689:
local articleCount = #args -- must be 1 except with selected=Foo and Foo=Somepage
if articleCount < 1 and not (template == "selected" and args[template] and args[args[template]]) then
return err("
end
Line 700:
local text, title = getContent(page)
if not title then
return err("
elseif not text then
return err("
end
if args["section"] then -- check relevant section only
text = getSection(text, args["section"], args["sectiononly"])
if not text then return err("
end
-- replace annotated links with real links
Line 775:
else
local hatnote = {}
hatnote[1] =
hatnote[2] = '[['
hatnote[3] = article .. (is(section) and ('#' .. frame:callParserFunction( 'urlencode', section, 'WIKI' )) or '')
Line 783:
hatnote[7] = "''" .. '<span class="mw-editsection-like plainlinks"><span>[ </span>['
local title = mw.title.new(article) or mw.title.getCurrentTitle()
hatnote[8] = title:fullUrl('action=edit') .. '
hatnote[9] = ']<span> ]</span></span>' .. "''"
output[4] = require('Module:Hatnote')._hatnote(table.concat(hatnote), {selfref=true}) or err("
end
output[5] = '<' .. tag .. ' class="excerpt">\n'
Line 805:
output[6] = "[[Category:" .. d.brokenCategory .. "]]"
else
output[6] = frame:preprocess(text) or err("
end
else
output[6] = err("
end
output[7] = '</' .. tag .. '>'
output[8] = is(args.indicator) and ('</' .. tag .. '>') or ''
output[9] = '</' .. tag .. '>'
output[10] = mw.title.getCurrentTitle().isContentPage and ('[[
return table.concat(output)
|