Replace editor vue-easymde with tiptap #1834

Open
opened 2021-09-23 13:54:19 +00:00 by dpschen · 8 comments
Member

I think for the longterm tiptap is a nice editor: V2 is in beta, but seems quite stable, v1 was just for vue so should be a good fit.

I originally thought that the library tiptap is based on — Prosemirror) — isn't updated that often anymore. I was mistaken. There is a lot of development happening right now. Looks really good!

Only problem: Tiptap 2 doesn't support Markdown as input / output, which makes sense. This will make some changes in the api neccessary. This is probably something that should wait until the vue3 transition is over. TipTap does support Markdown syntax while editing though.

The collaborative editing might also be intersting for the future. It might help with conflicting task edits, depending on how this is supposed to be implemented.

Maybe it's too overpowered for that usecase.

Honorable Mentions

I think for the longterm [tiptap](https://github.com/ueberdosis/tiptap) is a nice editor: V2 is in beta, but seems quite stable, v1 was just for vue so should be a good fit. I originally thought that the library tiptap is based on — Prosemirror) — isn't updated that often anymore. I was mistaken. There is a lot of development happening right now. Looks really good! Only problem: Tiptap 2 doesn't support Markdown as input / output, which [makes sense](https://tiptap.dev/guide/output#not-an-option-markdown). This will make some changes in the api neccessary. This is probably something that should wait until the vue3 transition is over. TipTap does support Markdown syntax while editing though. The [collaborative editing](https://tiptap.dev/examples/collaborative-editing) might also be intersting for the future. It might help with conflicting task edits, depending on how this is supposed to be implemented. Maybe it's too overpowered for that usecase. ### Honorable Mentions - **Just for react:** [slate](https://github.com/ianstormtaylor/slate) - **not enough maintenance:** [editorjs](https://editorjs.io/) -> https://github.com/factly/dega/discussions/378
Owner

I think tiptap would be great. There are markdown bindings for it: https://tiptap.dev/examples/markdown-shortcuts

The api doesn't make any assumptions about the format of the text. We could either just continue saving it in markdown, even when tiptap doesn't save it in markdown. Would be quite a bit of converting - to discuss?

I think tiptap would be great. There are markdown bindings for it: https://tiptap.dev/examples/markdown-shortcuts The api doesn't make any assumptions about the format of the text. We could either just continue saving it in markdown, even when tiptap doesn't save it in markdown. Would be quite a bit of converting - to discuss?
konrad added the
kind/feature
label 2021-09-23 18:30:31 +00:00
Author
Member

We could either just continue saving it in markdown, even when tiptap doesn't save it in markdown.

What do you mean by that? Convert the html /json output back to markdown (depending on implementation)? If we don't do that we can save a library in the frontend.

> We could either just continue saving it in markdown, even when tiptap doesn't save it in markdown. What do you mean by that? Convert the html /json output back to markdown (depending on implementation)? If we don't do that we can save a library in the frontend.
Owner

What do you mean by that? Convert the html /json output back to markdown (depending on implementation)?

Pretty much, yes.

But I've just read up on the tiptap docs on output formats and I think what they say makes sense. HTML looks the better option. I'd like to use HTML instead of Markdown because that's a format other possible clients can work with which can be complicated when using the JSON output.

> What do you mean by that? Convert the html /json output back to markdown (depending on implementation)? Pretty much, yes. But I've just read up on [the tiptap docs on output formats](https://tiptap.dev/guide/output#not-an-option-markdown) and I think what they say makes sense. HTML looks the better option. I'd like to use HTML instead of Markdown because that's a format other possible clients can work with which can be complicated when using the JSON output.
Author
Member

Makes sense. That should also be compatible with any editor in the future.

I guess the transition is still tricky.
All the markdown fields would either need to be converted to html or we would need a strategy to detect if a field got updated already (seems very tricky) and if not do this on the fly. Another option would be to have a separate field that saves if it got already updated.

I guess you already did some data model migrations before. How did you approach this back then?

Makes sense. That should also be compatible with any editor in the future. I guess the transition is still tricky. All the markdown fields would either need to be converted to html or we would need a strategy to detect if a field got updated already (seems very tricky) and if not do this on the fly. Another option would be to have a separate field that saves if it got already updated. I guess you already did some data model migrations before. How did you approach this back then?
Owner

I guess you already did some data model migrations before. How did you approach this back then?

I think we could just write an API migration to convert all descriptions and comments from Markdown to HTML. That's a bit agains clear separation of concerns but should be fine.

> I guess you already did some data model migrations before. How did you approach this back then? I think we could just write an API migration to convert all descriptions and comments from Markdown to HTML. That's a bit agains clear separation of concerns but should be fine.
Author
Member

That's a bit agains clear separation of concerns but should be fine.

If you see it as a change of the data model (which it kind of is) I guess even separation of concerns is fine :D

> That's a bit agains clear separation of concerns but should be fine. If you see it as a change of the data model (which it kind of is) I guess even separation of concerns is fine :D
Owner
More discussion: https://community.vikunja.io/t/images-pasted-into-text-fields-like-description-or-a-comment/470?u=kolaente
dpschen changed title from Replace vue-easymde with a better editor to Replace editor vue-easymde with tiptap 2021-11-30 12:06:18 +00:00
Author
Member

A old pull request that needs to be rebased: vikunja/frontend#2222

A old pull request that needs to be rebased: https://kolaente.dev/vikunja/frontend/pulls/2222
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1834
No description provided.