zefyr
zefyr copied to clipboard
1.0-dev NotusMarkdownCodec seems to add newline chars incorrectly
Steps to Reproduce
Type this text in the ZefyrEditor:
# TestTitle
TestBody
Then call:
String getText() {
final converter = NotusMarkdownCodec();
final text = converter.encode(zefyrCo.document.toDelta());
return text;
}
The output text is "# TestTitle\n\nTestBody\n\n", where the expected output is "# TestTitle\nTestBody" - note that:
- There wasn't a newline after
TestBody, but theencodeadded it and would keep adding more newlines each time I call it, so I have totrimRight()all the time. - Every existing newline is doubled, so I have to manually do
text = text.replaceAll("\n\n", "\n");all the time.
Probably an easy fix - thanks for providing this library!