Update formatting.js

Prevent dispatch Uncaught TypeError when styleTag is null