Tiptap: Directly edit source code

Created on 10 Oct 2018  路  3Comments  路  Source: ueberdosis/tiptap

Is there a way, to directly edit html source code? I mean, is there a way, to add a button to toggle wysiwyg view to source-code view?

Most helpful comment

This should be possible right now. There is an @update event on the editor component where you can grab the current HTML. Then you could add a toggle button and render this HTML in a textarea. And on change you could set the new content with this.$refs.editor.setContent('<div>your html</div>').

Would be a nice example for the demo page btw.

All 3 comments

This should be possible right now. There is an @update event on the editor component where you can grab the current HTML. Then you could add a toggle button and render this HTML in a textarea. And on change you could set the new content with this.$refs.editor.setContent('<div>your html</div>').

Would be a nice example for the demo page btw.

Thank you!

Hi,

I need to render in some case the html content directly in the editor. If copy paste, that works, but when i set the content on editor creation, i can't figure out how to render html source code.

Then you could add a toggle button and render this HTML in a textarea.

Are you talking about another text area than the editor ? I don't understand how can i do what you said

EDIT: I just saw that a feature has been released to view source code. How can i use this feature ?

Thanks.

Was this page helpful?
0 / 5 - 0 ratings