better version for converting padding from splaces to special html characters