[fix] correctly handle the conditionnal removing of a \n at the end of a string if it isn't present