hunghg255 / reactjs-tiptap-editor

A modern WYSIWYG rich text editor based on tiptap and shadcn ui for Reactjs
https://reactjs-tiptap-editor.vercel.app/
MIT License
203 stars 37 forks source link

May I ask how do your render the content to view? #106

Closed lqminh2207 closed 2 weeks ago

hunghg255 commented 2 weeks ago

you can check this https://www.w3schools.com/jsref/met_node_insertadjacenthtml.asp

lqminh2207 commented 2 weeks ago

@hunghg255 I found that on original lib has read-only instance. I can't find it in your lib. Do you have it?

https://tiptap.dev/docs/guides/output-json-html#render

image

hunghg255 commented 2 weeks ago

@hunghg255 I found that on original lib has read-only instance. I can't find it in your lib. Do you have it?

tiptap.dev/docs/guides/output-json-html#render

image

https://reactjs-tiptap-editor.vercel.app/guide/customize.html#_3-accessing-the-editor-instance you can refer this

lqminh2207 commented 2 weeks ago

I tried to set editable to false. But It seem only content is disabled and toolbar and border doesn't disappear image

hunghg255 commented 2 weeks ago

im not sure, can you create a repo, I will check help you

lqminh2207 commented 2 weeks ago

@hunghg255 What do you think about create new feature for read-only mode? Currently after save data then display that data it doesn't same as when we comment, I think because of CSS.

lqminh2207 commented 2 weeks ago

@hunghg255 Like on your playground. If using these HTML to display then content will not be the same on the editor image

hunghg255 commented 2 weeks ago

@hunghg255 What do you think about create new feature for read-only mode?

Currently after save data then display that data it doesn't same as when we comment, I think because of CSS.

yea. pull request welcome