@@ -254,20 +254,20 @@ def _escape_text(text):
254254 """
255255 result = text
256256 if isinstance (text , types .StringTypes ):
257- if '\\ ' in text :
258- result = text .replace ('\\ ' , '\\ \\ ' )
259- if '"' in text :
260- result = text .replace ('"' , '\\ "' )
261- if '\n ' in text :
262- result = text .replace ("\n " , "\\ \\ n" )
263- if '\b ' in text :
264- result = text .replace ("\b " , "\\ \\ b" )
265- if '\f ' in text :
266- result = text .replace ("\f " , "\\ \\ f" )
267- if '\r ' in text :
268- result = text .replace ("\r " , "\\ \\ r" )
269- if '\t ' in text :
270- result = text .replace ("\t " , "\\ \\ t" )
271- if '\/' in text :
272- result = text .replace ("\/" , "\\ \\ /" )
257+ if '\\ ' in result :
258+ result = result .replace ('\\ ' , '\\ \\ ' )
259+ if '"' in result :
260+ result = result .replace ('"' , '\\ "' )
261+ if '\n ' in result :
262+ result = result .replace ("\n " , "\\ \\ n" )
263+ if '\b ' in result :
264+ result = result .replace ("\b " , "\\ \\ b" )
265+ if '\f ' in result :
266+ result = result .replace ("\f " , "\\ \\ f" )
267+ if '\r ' in result :
268+ result = result .replace ("\r " , "\\ \\ r" )
269+ if '\t ' in result :
270+ result = result .replace ("\t " , "\\ \\ t" )
271+ if '\/' in result :
272+ result = result .replace ("\/" , "\\ \\ /" )
273273 return result
0 commit comments