Module:Excerpt: Difference between revisions

Content deleted Content added
Allow page name to be a wikilink
Calling getContent more properly (no functional difference)
Line 7:
local title = mw.title.new(pagename) -- Find the lead section of the named page
if not title then return "" end
local text = title.:getContent(title) or ""
 
text = mw.ustring.gsub(text, "%c%s*==.*","") -- remove first heading and everything after it