clean up pandoc code