17,273
edits
(be a little smarter about parsing transclusion args (still not handling named args, haven't needed those yet)) |
(instead of parsing raw content and then expanding some templates within the content, just expand the whole content as a template) |
||
Line 25: | Line 25: | ||
function handleLine( line, currentSection ) | function handleLine( line, currentSection ) | ||
local headingLevel, headingText = string.match( line, '^%s*(=+)%s*(.-)%s*=+$' ) | local headingLevel, headingText = string.match( line, '^%s*(=+)%s*(.-)%s*=+$' ) | ||
if headingLevel then -- line is a heading | if headingLevel then -- line is a heading | ||
Line 91: | Line 77: | ||
function p._parseListing( pageName, pageContent ) | function p._parseListing( pageName, pageContent ) | ||
local pageContent = pageContent or mw. | local pageContent = pageContent or mw.text.killMarkers( mw.getCurrentFrame():expandTemplate{ title = ':' .. pageName, args = {} } ) | ||
local root = { | local root = { | ||
level = 1, | level = 1, |