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

[WIP] Refactor HeadingBlock using tiptap #39

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

holazz
Copy link
Contributor

@holazz holazz commented Aug 3, 2022

Currently, TextBlock and QuoteBlock are implemented by the EditorContent component of tiptap, and HeadingBlock and DividerBlock 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.

@holazz
Copy link
Contributor Author

holazz commented Aug 3, 2022

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.

@greentfrapp
Copy link
Contributor

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?

@holazz
Copy link
Contributor Author

holazz commented Aug 3, 2022

@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.

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

Successfully merging this pull request may close these issues.

None yet

2 participants