Module:Excerpt/sandbox: Difference between revisions

Content deleted Content added
Merging the new fragment transclusion functionality into the new excerpt function
Fix excerpt function
Line 799:
output[5] = '<' .. tag .. ' class="excerpt">\n'
if article ~= '{{{1}}}' then
local options = args -- pickturn uptemplate miscellaneousarguments options:into more,module errors, fileargsoptions
options.paraflags = numberFlags(args.paragraphs or "") -- parse paragraphs, e.g. "1,3-5" → {"1","3-5"}
options.fileflags = numberFlags(args.files or "1") -- parse file numbers
options.nobold = 1
options.fragment = args.fragment
options.keepTables = is(args.tables) or 1
options.keepRefs = is(args.references) or 1
options.keepSubsections = is(args.subsections)
 
if options.more and options.more == "" then options.more = "Read more..." end -- more= is short for this default text
local pageNames = { (article .. '#' .. (section or '')) }
local text = main(pageNames, options)
 
if text == "" and d.brokenCategory and d.brokenCategory ~= "" and mw.title.getCurrentTitle().isContentPage then
output[6] = "[[Category:" .. d.brokenCategory .. "]]"