Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Missing line break after bold or italic words #87

Closed
Jonathanm10 opened this issue Jun 12, 2018 · 6 comments
Closed

Missing line break after bold or italic words #87

Jonathanm10 opened this issue Jun 12, 2018 · 6 comments
Assignees
Labels

Comments

@Jonathanm10
Copy link

Jonathanm10 commented Jun 12, 2018

Hello,

At the moment, line break in the quill editor are rendered as <br> inside paragraphs which is perfect. But the feature is missing for bold and italic format.

Delta

{"ops":[{"attributes":{"bold":true},"insert":"Bold text"},{"insert":"\nAny text\n"}]}

Is rendered

<p><strong>Bold text</strong>Any text</p>

Should be

<p><strong>Bold text</strong><br>Any text</p>
@raphaelsaunier
Copy link

raphaelsaunier commented Jun 12, 2018

Looks like the parser doesn't handle the leading \n character in the insert.

If it helps, @deanblackborough, here's a JS Bin with the Delta that is causing the issue: http://output.jsbin.com/juvopet/1

@deanblackborough
Copy link
Owner

deanblackborough commented Jun 12, 2018

Cheers chaps, I'll fix this and the other outstanding bugs this evening, thank you both for the example inserts, I can add them to the tests.

@deanblackborough
Copy link
Owner

No time tonight, will be fixed and a new version out before the end of the week.

deanblackborough added a commit that referenced this issue Jun 13, 2018
* Bug fix for issue #87, added support for pre nw line in an insert, updated a couple of test expected results.
@deanblackborough
Copy link
Owner

Fixed in 3.13.0, added support for pre_new_lines,
tags added if there is a \n proceeding the insert string.

@raphaelsaunier
Copy link

Thanks! We ran into other issues with slightly more complex documents (e.g. bold/link formatting in lists) which forced us to drop your library for the time being.

I can send you a PR with a failing test case or at least an issue if you can't reproduce it.

@deanblackborough
Copy link
Owner

@raphaelsaunier I've spotted the issue, lists don't seem to like any formatting, I've an issue in the system now and will correct it.

Thank you for mentioning it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants