def direct_format_text(text):
 return text.replace('\n', '\\n').replace('\r', '\\r')

def direct_format_text ( text ) : return text . replace ( '\n' , '\\n' ) . replace ( '\r' , '\\r' )
transform special chars in text to have only one line .