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

feat: Allow Markdown and Html in InitialContent #405

Open
fedjabosnic opened this issue May 31, 2024 · 2 comments
Open

feat: Allow Markdown and Html in InitialContent #405

fedjabosnic opened this issue May 31, 2024 · 2 comments

Comments

@fedjabosnic
Copy link

Describe the feature you'd like to request

I'd like to set initial content to Markdown or Html in string form, received over the wire. At present, the Novel Editor only allows JSONContent to be passed into initialContent and there is no easy facility to convert. This makes it very hard to work with HTML and MD content directly, especially in string form..

Describe the solution you'd like to see

Looking at the types in the core TipTap library, it seems that we can use the union type Content - or even define a union type ourselves. I'm not sure if there are some roadblocks in the codebase but this would allow us to pass any supported type of content to the editor...

CleanShot 2024-05-31 at 16 42 23@2x

Additional information

My use-case is simple, I want to edit content coming from an api call that is either Markdown or Html, and at the moment I can't really get this running. Admittedly I'm not super experienced in Next, React or TipTap so please let me know if there is a decent solution already

@MODSetter
Copy link
Contributor

@fedjabosnic Markdown is not supported by Tiptap. I can look into making editor compatible with html. For your current use case you can see html updates in LocalStorage (key: "html-content").

@jacobsamo
Copy link

Would also love this feature as i want to store the content in my db as HTML or text

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

3 participants