fix node swapping on markdown edit mode