Module:Excerpt: Difference between revisions

Content deleted Content added
Remove Template:When
Remove a line which is just a template: typically used for navboxes in footer etc.
Line 319:
local files = 0 -- how many images so far
local paras = 0 -- how many paragraphs so far
local startLine = true -- at the start of a line (no non-spaces found since last \n)?
 
text = mw.ustring.gsub(text,"^%s*","") -- remove initial white space
Line 333 ⟶ 334:
 
if token then -- found a template which is not the prefix to a line of text
if leadstart then -- lead has already started, so keep the template within the text, unless it's a whole line (navbox etc.)
if not filesOnly and not startLine then t = t .. token end
elseif files < maxfile then -- discard template, but if we are still collecting images...
local images = argimage(token) or {}
Line 385 ⟶ 386:
 
if token then text = mw.ustring.sub(text, mw.ustring.len(token)+1) end -- remove parsed token from remaining text
startLine = mw.ustring.find(token, "\n%s*$"); -- will the next token be the first non-space on a line?
until not text or text == "" or not token or token == "" -- loop until all text parsed