Content deleted Content added
replace wikitext numbered lists with html numbered list; generalise replacement functions |
preprocess parser functions |
||
Line 78:
end
-- help gsub strip tables and templates that aren't part of the prose,
-- and remove linebreaks from within other templates, -- and preprocess parser functions
local processBraces = function(t)
local isTable = mw.ustring.sub(mw.text.trim(t), 2, 2) == '|'
Line 84 ⟶ 86:
return ''
end
-- else it's a template or parser function
local first = mw.ustring.sub(t, 1, 1)
local last = mw.ustring.sub(t, -1)
Line 90 ⟶ 92:
if isNotPartOfProse then
return ''
end
local isParserFunction = mw.ustring.sub(mw.text.trim(t), 3, 3) == '#'
if isParserFunction then
local frame = mw.getCurrentFrame()
return frame:preprocess(t)
end
-- else replace pipes and remove internal linebreaks
|