-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line breaks are not being converted #20
Comments
Hi @yassinsameh, thank you for opening an issue. This is to be expected when dealing with Markdown, you can also test it on https://dart-lang.github.io/markdown/ and confirm it. if you want to add a hard line break that's not ignored you can add Please let me know if you need any extra help regarding this issue. |
Hi @TarekkMA , sorry i don't get your point with the converter, it's converting to html while i'm converting to deltas. For other reference: Using the flutter_markdown package , with the same String, the output is formatted correctly with line breaks, could you please take a look. I believe the solution is possibly in the EmptyBlockSyntax class parse method. To give more context to the use case, i'm converting an llm output to deltas, so it wouldn't be very possible to add line breaks manually really, think it would be very hacky with weird edge cases. |
If the issue is line breaks are not converted, this is an expected behavior. 1 line break is ignored, but 2 or more line breaks converts only to one line break. Vanilla Dart Markdown test (https://dart-lang.github.io/markdown/) flutter_markdown test (https://tarekkma.github.io/markdown_quill_playground/) Github markdown test (https://gist.github.com/) If you want to maintain line breaks just replace |
Thank you for taking the time to look at this. That behavior of >= 2 line breaks will generate only one empty line is fine. So case 1: "test/nbar".
Case 2: "test/n/nbar".
Correct expected output:
Case 3 you mentioned above: "test/n/n/n/nbar":
|
Thank you for the clear examples, will try to figure out what's the issue. |
Hi @TarekkMA, managed to take a look? I believe the solution is possibly in the EmptyBlockSyntax class parse method. |
I did it something like this
|
@TarekkMA - did you get a chance to look into this. This change would be of great help. |
Looks pretty normal. Consider (inserting like a dozen linebreaks right here) this comment, for example. |
With the following example json: "Example text/n/nTable of Contents",
Expected:
Result:
markdown_quill: ^3.1.0
flutter_quill: ^9.3.1
Code:
The text was updated successfully, but these errors were encountered: