Quill: <div> instead <p> in content

Created on 15 Aug 2016  路  2Comments  路  Source: quilljs/quill

Can you use"<div>" instead "<p>"?

<div id="editor">
  <p>Hello World!</p>
  <p>Some initial <strong>bold</strong> text</p>
  <p><br></p>
</div>

Result:

<div id="editor">
  <div>Hello World!</div>
  <div>Some initial <strong>bold</strong> text</div>
  <div><br></div>
</div>

Most helpful comment

Yes you just need to change the default Block tag name:

var Block = Quill.import('blots/block');
Block.tagName = 'DIV';
Quill.register(Block, true);

Here's a demonstration. There will be an in depth guide on using Parchment / Blots soon.

All 2 comments

Yes you just need to change the default Block tag name:

var Block = Quill.import('blots/block');
Block.tagName = 'DIV';
Quill.register(Block, true);

Here's a demonstration. There will be an in depth guide on using Parchment / Blots soon.

Thanks for the solution!

Is it possible to customize this for just one editor on a page as I have multiple editors with different use cases on the same page?

Any help would be appreciated!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yves-K picture Yves-K  路  3Comments

scottfr picture scottfr  路  3Comments

splacentino picture splacentino  路  3Comments

lustoykov picture lustoykov  路  3Comments

kheraud picture kheraud  路  3Comments