Update Formatter.js

Fix bug #6214
After turning off formatting from the current position, remove the formatting node if it is empty.