KillerCodeMonkey / ngx-quill

Angular (>=2) components for the Quill Rich Text Editor
MIT License
1.78k stars 259 forks source link

question about empty lines in the quill-view-html component #1883

Closed haykoaghababyan closed 4 months ago

haykoaghababyan commented 4 months ago

image

Why the empty rows between (example) words don't appear ? it shows like this

examples examples

haykoaghababyan commented 4 months ago

I am using latest version of quill and ngx-quill

haykoaghababyan commented 4 months ago

but when using quill editor with the read only equal true, it works fine with empty lines

KillerCodeMonkey commented 4 months ago

i extended my demo repo

https://killercodemonkey.github.io/ngx-quill-example/#view check the "View format: HTML - sanitized" example. empty lines are there.

PS: it is working with p and div tags as block blot

KillerCodeMonkey commented 4 months ago

Are those p-tags in your dom? so maybe it is a styling issue?

haykoaghababyan commented 4 months ago

when we using quill editor with the form control. and trying setValue this string with empty lines, inside empty p tags in the dom I noticed br tags, that is why it is working with ( [readonly]=true) fine, but the same br tags for view html component I didn't notice

haykoaghababyan commented 4 months ago

image image

haykoaghababyan commented 4 months ago

i extended my demo repo

https://killercodemonkey.github.io/ngx-quill-example/#view check the "View format: HTML - sanitized" example. empty lines are there.

PS: it is working with p and div tags as block blot

yes your example works , because you use quill-view,, but my example quill-view-html

KillerCodeMonkey commented 4 months ago

Quillview HTML is a silly component. It just renders the HTML you pass and wrapping it in a container with the base quill css classes to get styling working.

So if your HTML misses the br tags quill-view-html will not do the quill magic for you.

If you do not have valid/complete quill HTML content use the quill-view component

haykoaghababyan commented 4 months ago

got it thanks

haykoaghababyan commented 4 months ago

Hi @KillerCodeMonkey , What solution can you suggest to preserve whitespaces in the quill-view component? The preservingWhiteSpaces property has been removed. it works in the quill-view-html component because it uses innerHtml , but the quill-view component uses different logic.

KillerCodeMonkey commented 4 months ago

There is no way with quill v2. Since it's not supported anymore.

Quill-view just uses a quill editor in readonly mode.