@@ -257,20 +257,20 @@ def _escape_text(text):
257257 """
258258 result = text
259259 if isinstance (text , types .StringTypes ):
260- if '\\ ' in text :
261- result = text .replace ('\\ ' , '\\ \\ ' )
262- if '"' in text :
263- result = text .replace ('"' , '\\ "' )
264- if '\n ' in text :
265- result = text .replace ("\n " , "\\ \\ n" )
266- if '\b ' in text :
267- result = text .replace ("\b " , "\\ \\ b" )
268- if '\f ' in text :
269- result = text .replace ("\f " , "\\ \\ f" )
270- if '\r ' in text :
271- result = text .replace ("\r " , "\\ \\ r" )
272- if '\t ' in text :
273- result = text .replace ("\t " , "\\ \\ t" )
274- if '\/' in text :
275- result = text .replace ("\/" , "\\ \\ /" )
260+ if '\\ ' in result :
261+ result = result .replace ('\\ ' , '\\ \\ ' )
262+ if '"' in result :
263+ result = result .replace ('"' , '\\ "' )
264+ if '\n ' in result :
265+ result = result .replace ("\n " , "\\ \\ n" )
266+ if '\b ' in result :
267+ result = result .replace ("\b " , "\\ \\ b" )
268+ if '\f ' in result :
269+ result = result .replace ("\f " , "\\ \\ f" )
270+ if '\r ' in result :
271+ result = result .replace ("\r " , "\\ \\ r" )
272+ if '\t ' in result :
273+ result = result .replace ("\t " , "\\ \\ t" )
274+ if '\/' in result :
275+ result = result .replace ("\/" , "\\ \\ /" )
276276 return result
0 commit comments