diff --git a/lib/src/serializable.dart b/lib/src/serializable.dart index fb9b8c5..9dc397d 100644 --- a/lib/src/serializable.dart +++ b/lib/src/serializable.dart @@ -193,7 +193,7 @@ class Serializer { if (value == null) { buffer.write('null'); } else if (value is String) { - final text = value.replaceAll('"', r'\"'); + final text = value.replaceAll('"', r'\"').replaceAll('\n', '\\n'); buffer..write('"')..write(text)..write('"'); } else if (value is int) { buffer.write(value);