Interesting problem using the DokuWiki sidebar plugin and headings in the sidebar markup. If you put headings in the table of contents for the page seems to pick these up in preference to the headings in the actual page. Solution – don’t use headings in the sidebar.