You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, when I try to get a Document from it (using Document.fromJson(jsonDecode(jsonEncode(_controller.document.toDelta().toJson()))) it doesn't work because it has \n instead of \\n and because there is no {"insert": "\\n"} at the end (or I need to append 'r' in front of the string to denoted as a raw string. How should I deal with this? tks
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
The question
I have create this simple text to see how
jsonEncode(_controller.document.toDelta().toJson())
. This was the text in markdown:TITLE
CATEGORY: Category
LIST
ORDERED LIST
This is what
jsonEncode(_controller.document.toDelta().toJson())
returned:[{"insert":"Title\n","attributes":{"header":3}},{"insert":"CATEGORY: ","attributes":{"bold":true}},{"insert":"Category\n\n"},{"insert":"LIST","attributes":{"bold":true}},{"insert":"\n"},{"insert":"Item\n","attributes":{"list":"bullet"}},{"insert":"Item:","attributes":{"list":"bullet","bold":true}},{"insert":" item\n","attributes":{"list":"bullet"}},{"insert":"\n"},{"insert":"ORDERED LIST","attributes":{"bold":true}},{"insert":"\n"},{"insert":"First\n","attributes":{"list":"ordered"}},{"insert":"Second: ","attributes":{"list":"ordered","bold":true}},{"insert":"second\n","attributes":{"list":"ordered"}}]
Now, when I try to get a Document from it (using
Document.fromJson(jsonDecode(jsonEncode(_controller.document.toDelta().toJson())))
it doesn't work because it has\n
instead of\\n
and because there is no{"insert": "\\n"}
at the end (or I need to append 'r' in front of the string to denoted as a raw string. How should I deal with this? tksThe text was updated successfully, but these errors were encountered: