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

Need to use span instead of p tag #4297

Open
Ashritha-12 opened this issue Jul 7, 2024 · 1 comment
Open

Need to use span instead of p tag #4297

Ashritha-12 opened this issue Jul 7, 2024 · 1 comment

Comments

@Ashritha-12
Copy link

Ashritha-12 commented Jul 7, 2024

<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>
@AltiorPetitM
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants