Skip to content
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

Empty lines with the 'align' attribute aren't properly rendered #36

Closed
ivoegcosta opened this issue Jan 23, 2020 · 2 comments
Closed

Empty lines with the 'align' attribute aren't properly rendered #36

ivoegcosta opened this issue Jan 23, 2020 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ivoegcosta
Copy link

Describe the bug

When the text is aligned to the center and two new lines are inserted before proceeding to write text, the generated output doesn't include the <br> tag on the middle line.

It instead adds an empty paragraph between the two lines of text, which doesn't match the Quill output.

The delta code which generates the problem

{"ops":[{"insert":"Centered text"},{"attributes":{"align":"center"},"insert":"\n\n"},{"insert":"Line three?"},{"attributes":{"align":"center"},"insert":"\n"}]}

This generates the following output:

<p style="text-align: center;">Centered text</p><p style="text-align: center;"></p><p style="text-align: center;">Line three?</p>

The expected HTML output the delta should produce

<p style="text-align: center;">Centered text</p><p style="text-align: center;"><br></p><p style="text-align: center;">Line three?</p>

Expected behavior

The second line, even though it doesn't contain any text, should still render in order to space out the two lines of text correctly.

Additional context

I managed to pinpoint the issue to the align implementation, given that if I remove the {"align":"center"} from the empty line, it renders correctly as <p><br><p>.

I believe the <br> tag might be escaped within the wrapElement call that is made from the Align listener.

@nadar nadar added bug Something isn't working help wanted Extra attention is needed labels Jan 23, 2020
This was referenced Apr 13, 2020
@nadar
Copy link
Owner

nadar commented Sep 14, 2023

i try to keep the issue tracker clean, please reopen if necessary.

@nadar nadar closed this as completed Sep 14, 2023
@nadar
Copy link
Owner

nadar commented Sep 14, 2023

4.0 refactor will not happen. Sorry. Quill is abandoned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants