core: markup pep8 fixes and better sub/superscript positioning