Some cleanup on html before saving

This will eventually moved to server as noted as TODO

Change-Id: I0e3e81fd09e6fb3029db1b5dfecf4157b6b34e57