Content manipulation in beforeUpdate lifecycle preventing from publish

Update:
I think this is because output of sanitize-html has a different formatting than ckeditor (sanitize-html removes indentation, new line characters, etc, whereas ckeditor always reformats the source. This causes the field to be constantly in a changed state.

Does anyone know if I can configure either of them to accept the other’s formatting?