trim the text so that the default value is inserted even when only spaces are present