FANDOM


local p = {}
 
-- Remove <ref></ref> tags
function p.stripRefs( text )
	local newText = mw.ustring.gsub( mw.ustring.gsub( mw.text.unstrip( text ), '<[^>]*>[^<]*<\/[^>]*>', '' ), '<\/?[^>]*>', '' )
	return newText
end
 
function p.snippet( frame )
	local text = mw.text.trim( frame.args[1] or '' )
	if text == '' then
		return ''
	end
 
	-- Get the first non-empty, non-Heading line
	local newText = ''
	for line in mw.text.gsplit( text, '\n' ) do
		local lineTrimmed = mw.text.trim( line )
		if lineTrimmed ~= '' and mw.ustring.match( lineTrimmed, '^==' ) == nil then
			newText = lineTrimmed
			break
		end
	end
 
	newText = mw.ustring.sub( p.stripRefs( newText ), 1, 300 )
 
	return '<span style="display: none;">' .. newText .. '</span>'
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.