Module:Documentation: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 152: | Line 152: | ||
end | end | ||
mw.logObject( body, 'Module:Documentation: body') | mw.logObject( body, 'Module:Documentation: body' ) | ||
return mw.getCurrentFrame():extensionTag{ name = "templatestyles", args = { src = 'Module:Documentation/styles.css' } } .. tostring( body ) | return mw.getCurrentFrame():extensionTag{ name = "templatestyles", args = { src = 'Module:Documentation/styles.css' } } .. tostring( body ) | ||
| Line 161: | Line 161: | ||
-- mw.text.trim uses mw.ustring.gsub, which silently fails on large strings | -- mw.text.trim uses mw.ustring.gsub, which silently fails on large strings | ||
local function trim( s ) | local function trim( s ) | ||
return (s:gsub( '^[\t\r\n\f ]+', '' ):gsub( '[\t\r\n\f ]+$', '' )) | return ( s:gsub( '^[\t\r\n\f ]+', '' ):gsub( '[\t\r\n\f ]+$', '' ) ) | ||
--return string.gsub( s, '^[\t\r\n\f ]*(.-)[\t\r\n\f ]*$', '%1' ) | --return string.gsub( s, '^[\t\r\n\f ]*(.-)[\t\r\n\f ]*$', '%1' ) | ||
end | end | ||
| Line 188: | Line 188: | ||
docText = trim( f:expandTemplate{ title = ':' .. docPage.fullText } ) | docText = trim( f:expandTemplate{ title = ':' .. docPage.fullText } ) | ||
if static.badDoc and static.badDoc == '1' then | if static.badDoc and static.badDoc == '1' then | ||
mw.logObject(static, | mw.logObject( static, 'static' ) | ||
badDoc = 1 | badDoc = 1 | ||
end | end | ||
| Line 286: | Line 286: | ||
end | end | ||
return mw.getCurrentFrame():extensionTag | return mw.getCurrentFrame():extensionTag{ name = "templatestyles", args = { src = 'Module:Documentation/styles.css' } } .. tostring( body ) .. tostring( anchor ) | ||
end | end | ||
return p | return p | ||