How to remove a link from text(remove a link)
Question
using built-in RTE and trying to add a rte custom button that when clicking, it removes current link. Could you provide me with the code please?
something like this...
rte.add('custom-remove-all', {
icon: 'remove',
attributes: {title: 'Link', class: 'gjs-rte-action'},
result: rte => rte.insertHTML(${rte.selection()})
});
Answers (2)
You can use rte.exec('unlink')
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1669
[Question] Custom link modal doesn't update the current text but add another text with link
Hello Artur, I'm trying to have a custom modal when clicked link button in RTE. but it doesn't convert selected text to link but what it do...
Issue #572
rich text editor issue
How to add the icon of ordered List in rich text editor? Here is my code. rte.add('insertOrderedList', { icon: '',//how to add the icon of...
Issue #1702
[Question]How to get rte selection inside the result function
I'm basically trying to put an input fieldinside the RTE so that users can make link more easily. console.log(<a href="#">${rte.selection()...
Issue #1639
[Question]: Would it be possible to have change settings under style manager in a way that it has href when a link is created?
I'm using preset newsletter with built-in RTE (do not want to use ck editor like the demo) In order to make any text to link, i need to cli...
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.