fix markup conversion in both directions