Content deleted Content added
m sync |
shuffle around |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1:
local p = {}
local excerptModule = require('Module:Excerpt/portals/sandbox')
local slideshowModule = require('Module:Random slideshow/sandbox')
local randomModule = require('Module:Random')
Line 88:
end
)
end
Line 114 ⟶ 110:
return frame:preprocess(t)
end
-- else
return
end
Line 121 ⟶ 117:
-- strip galleries
excerpt = mw.ustring.gsub(excerpt, "<%s*[Gg]allery.->.-<%s*/%s*[Gg]allery%s*>", "")
-- strip tables and block templates; strip newlines
excerpt = mw.ustring.gsub(excerpt..'\n', '\n?%b{}\n?', processBraces)
-- replace wikitext bulleted lists with html bulleted lists
excerpt = gsubWikitextLists(excerpt, '*', 'ul', 'li')
Line 156 ⟶ 148:
excerpt = excerpt .. " ('''[[" .. title .. "|" .. options.more .. "]]''')"
end
local text = '<div style
table.insert(galleryArgs, 'File:Blank.png')
table.insert(galleryArgs, text)
Line 178 ⟶ 170:
options.paraflags = excerptModule.numberFlags(args.paragraphs or "") -- parse paragraphs, e.g. "1,3-5" → {"1","3-5"}
options.fileflags = excerptModule.numberFlags(args.files or "") -- parse file numbers
options.ignoreOnlyincludes = options.ignoreOnlyincludes == nil and true or options.ignoreOnlyincludes -- default to true
if args.nostubs and isDeclined(args.nostubs) then
options.nostubs = false
Line 211 ⟶ 204:
-- begin BHG addition for tracking source pages
local thisPage = mw.title.getCurrentTitle().nsText .. ":" .. mw.title.getCurrentTitle().text
thisPage = thisPage:gsub('_', ' ') -- fix the nsText part, until [[phab:T369784]] is resolved
local thisBareParam = mw.ustring.gsub(args[ii], "^([^#]+).*$", "%1", 1) -- strip any section anchor from the parameter's page name
thisBareParam = thisBareParam:gsub('_', ' ') -- support underscores in parameter's page name
if (thisPage == thisBareParam) then
usesEmbeddedList = true;
Line 254 ⟶ 249:
local parent = frame.getParent(frame)
local output = p._excerpt(parent.args, 'random')
return frame:extensionTag{ name='templatestyles', args = { src='Module:Random slideshow/sandbox/styles.css'} }
end
Line 261 ⟶ 257:
local parent = frame.getParent(frame)
local output = p._excerpt(parent.args, 'linked')
return frame:extensionTag{ name='templatestyles', args = { src='Module:Random slideshow/sandbox/styles.css'} }
end
Line 268 ⟶ 265:
local parent = frame.getParent(frame)
local output = p._excerpt(parent.args, 'listitem')
return frame:extensionTag{ name='templatestyles', args = { src='Module:Random slideshow/sandbox/styles.css'} }
end
|