Fix stockholm parser bugs when parsing markup

Fixes #676.