Open holazz opened 2 years ago
I have refactored the H1 block by tiptap, after that I will refactor H2, H3 and Placeholder. What do you think? @greentfrapp If you don't recommend this, I will close this PR.
Thanks for looking into this @holazz! I was also thinking about it as well but on second thought, I feel like the benefits might not warrant the effort, so I'm inclined not to recommend this for now. But I'd like to leave this PR here for future reference.
What did you mean by refactoring the Placeholder though? Would that be for the Divider block?
@greentfrapp Thanks for your response! I mean the placeholder style of HeadingBlock
and TextBlock
can be refactored by tiptap placeholder extension.
Divider and Quote can also be implemented by tiptap: https://tiptap.dev/api/nodes/horizontal-rule https://tiptap.dev/api/nodes/blockquote
However, this PR is just a preliminary refactoring of H1 block, and refactoring all blocks would be huge work. So I respect your opinion, and maybe do it in the future when needed.
Currently,
TextBlock
andQuoteBlock
are implemented by theEditorContent
component of tiptap, andHeadingBlock
andDividerBlock
are not implemented by tiptap. In some cases, we have to deal with the two types of blocks separately. In this PR I want to refactor all blocks by tiptap.