Need to use span instead of p tag
<div id="editor">
<p>Hello World!</p>
<p>Some initial <strong>bold</strong> text</p>
<p><br></p>
</div>
want my output like this:
< div id="editor">
<span>Hello World!</p>
<span>Some initial <strong>bold</strong> text</p>
<span><br></span>
< /div>
HI ^^, you can redifine the block blots to use span instead of p tag
import Quill from 'quill'
const Block = Quill.import('blots/block')
Block.tagName = 'SPAN'
export default Block
You then need to register your new blot to quill so he use yours and not the default one.
Quill.register(Block, true)
And now you have span instead of p
As I needed the <span> along with the<p> I did the following edit, hope it helps who needs it.
in the quill.js or quill.min.js (which ever you include)
find the "h6" and add "span" after it, then the 2nd "H6"and add "SPAN" after it, case sensitive.
then in quill.snow.css find 'Heading 6' and add the following after the end of the block "}"
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="7"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="7"]::before{content:'Span'}
last step, in your js code where you call for new Quill be sure to set the header as the following
{ "header": [false, 1, 2, 3, 4, 5, 6, 7] }
now you have <span> as additional format in the header where it will replace the <p> when needed