Restore to changes made in pull request #4102

This reverts the experimental changes made on the master branch which virtually reset #4102. The changes made break the editor badly when RTL tags are already set (same behaviour as before the original pull request as demonstrated in screen shots).

If changes are to be made that can break the UI for those of us running off HEAD of master, they should be done in another branch.