Try using backslash to escape newlines in SIL strings
thanks https://stackoverflow.com/a/54336425
This commit is contained in:
parent
b81c33cda8
commit
c94774fbb7
|
@ -110,6 +110,10 @@ class Writer(Object):
|
|||
# file. so must cleanup anything that would complicate that
|
||||
value = value.replace('\r\n', '\n')
|
||||
|
||||
# nb. also, if a string value does contain newlines, we must
|
||||
# embed backslash to properly escape them
|
||||
value = value.replace('\n', '\\\n')
|
||||
|
||||
value = value.replace("'", "''")
|
||||
return f"'{value}'"
|
||||
|
||||
|
|
Loading…
Reference in a new issue