Some modifications to support diff highlighting in the richtext editor