The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 3: | Line 3: | ||
function p.getWorldbuilderSection(frame) | function p.getWorldbuilderSection(frame) | ||
-- Get the title of the current page | -- Get the title of the current page | ||
local pageTitle = mw.title.getCurrentTitle(). | local pageTitle = mw.title.getCurrentTitle().text | ||
-- Fetch the content of the Talk page | -- Fetch the content of the Talk page | ||
local talkPage = mw.title.new( | local talkPageTitle = 'Talk:' .. pageTitle | ||
local talkContent = | local talkPage = mw.title.new(talkPageTitle) | ||
local talkContent = talkPage:getContent() | |||
-- Check if the Talk page exists and has content | -- Check if the Talk page exists and has content | ||
if not talkContent | if not talkContent then | ||
return ' | return 'No content found in Talk page.' | ||
end | end | ||
Line 31: | Line 21: | ||
-- Check if the Worldbuilder section exists | -- Check if the Worldbuilder section exists | ||
if not worldbuilderSection then | if not worldbuilderSection then | ||
return ' | return 'No Worldbuilder section found.' | ||
end | end | ||
-- | -- Return the Worldbuilder section content | ||
return worldbuilderSection | |||
return | |||
end | end | ||
return p | return p |