Remove useless spaces in generated code

Handles html entity reference