Can we implement Paste as Rich text editor options in Rte?
Question
hi @artf I've gone through this Drag and Drop Editor and what an amazing work. I also read your docs and I tried to extend rich text editor but i m stuck b/w some thing. As you can see screen shot below i've added different options for Rich text Editor I implemented "paste as plain text" i want to another option for paste as rich text editor (formatted text with all styling and stuff" So is it possible to do that Like here the code of mine paste option Here i take a common variable with "" this and in cut option i write common = rte.selection().toString(); rte.exec('cut')} because default pas...
Answers (3)
Use insertHTML instead of insertText
hi @artf Here is my code. rte.add('insertHTML', { name: 'insertHTML', icon: '<i class="fa fa-paste"></i>', attributes: {title: 'PasteAsPlainText', "data-tooltip": 'PasteAsPlainText'}, result: rte => { rte.exec('insertHTML', prompt("Because of your browser security settings, the editor is not able t...
insertHTML is the native way to insert HTML strings but probably each browser implements its own set of rules.
Instead, check this https://stackoverflow.com/questions/25941559/is-there-a-way-to-keep-execcommandinserthtml-from-removing-attributes-in-chr/25943182#25943182
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1162
[Question]: Editable components in Handlebars rendered template
Hi, I've been using grapes for about a couple of days now. Thanks for the awesome work on this project. I've read through the API docs (hop...
Issue #1756
Drag and Drop not working in resized editor window in Google Chrome
Hi, I developed some components and all works fine in Firefox, Opera browser. In Google chrome also working fine in fullscreen editor mode...
Issue #1296
Custom Rich Text Editor is not working
Hi @artf, I've just created a custom plugin of the RTE using different libraries like CKEditor 5, TinyMCE 4 or pell but all of them with th...
Issue #1022
[BUG] Drag and drop blocks are not working in IE Browser
Hi, There is some bug related to "Drag and drop blocks are not working in IE Browser ", I didn't get better solution regarding this issue....
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.