Changes
undo again - the bug in frame:expandTemplate has now been fixed, so using it again
if not content and docTitle and docTitle.exists then
local frame = mw.getCurrentFrame()
content = frame:preprocess('expandTemplate{{ ' .. title = docTitle.prefixedText .. ' }}')
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end