Ngx-quill: new line generates <p>

Created on 12 Feb 2020  路  8Comments  路  Source: KillerCodeMonkey/ngx-quill

Hi.

My problem is that the WYSIWYG is currently "you don't get what you see" and here is the example

image

this is written in Angular 8 with the newest version of Quill editor.

Why is the new line a <p>?

<p> is styled by the browser by default:

image

Is this actually a bug or a feature? :P

Thank you.

All 8 comments

depends on your project.

you need to include quilljs css when you work with html-content,
because like you posted... not the quilljs css is used ;-).

So it is a bug in your usage :D.

quilljs only adds classes to the output html-tags, so if you do not include quilljs css in your page where you want to show the editor content your styling or the default browser styling will be applied - like margin-bottom of 1rem per p-tag.

It is possible to switch to inline styling with quilljs, but i do not recommend it:
https://quilljs.com/guides/how-to-customize-quill/#class-vs-inline

And in my demo:
https://killercodemonkey.github.io/ngx-quill-example/

you see (Format - HTML example). That it is possible to "wysiwyg" :-)

Sorry that is not the solution because the text is displayed in another project... there is no quill css imported... and imo the <p> tag is not the correct way to get a line-break (</br>?)

Maybe just implement a button to make a paragraph :D

like i said.. i only provide this angular wrapper for quilljs.. and quilljs is working this way.

Or like i said use inline styling to store all styles inline in the html you store in your db. ;-)

Hey @KillerCodeMonkey
is this possible in some way?

https://codepen.io/quill/pen/VjgorV

the example is from here:
https://github.com/quilljs/quill/issues/861#issuecomment-239961806

sure i am doing it actually in my demo repo :D.

In general you can do it, like it is done with native quilljs.

https://github.com/KillerCodeMonkey/ngx-quill-example/blob/e1bd33b5ac9dc6e219bddeeb89f449e7c766e197/src/app/app.component.ts#L9

dude this is not stack overflow and nobody can help you by looking on screenshots...
just check my demo repo.. it is working there.

bisschen netter kann man trotzdem sein ;)

das hat doch nix mit nett oder nicht nett zu tun ;-). War eine ganz normale Aussage :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wupaz picture wupaz  路  25Comments

ThomasOliver545 picture ThomasOliver545  路  24Comments

manandkumaar picture manandkumaar  路  26Comments

zpydee picture zpydee  路  80Comments

m41n picture m41n  路  18Comments