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

Batch remove links button #2777

Closed
coolrecep opened this issue May 1, 2018 · 2 comments
Closed

Batch remove links button #2777

coolrecep opened this issue May 1, 2018 · 2 comments

Comments

@coolrecep
Copy link

Expected behavior.

Ability to remove all hyperlinks in texts

Actual behavior.

No button to do that

Steps to reproduce the problem.

Remove one by one...

OS.

10 x64 1803

Browser.

Chrome 66

@stefanneculai
Copy link
Contributor

Thanks for the feature-request, @coolrecep .

@mpssoft
Copy link

mpssoft commented May 10, 2018

create a custom button to remove all links href attribute:

$.FroalaEditor.DefineIcon('unlink', {NAME: 'unlink'});
		$.FroalaEditor.RegisterCommand('unlink', {
		  title: 'unlink all links',
		  focus: true,
		  undo: true,
		  refreshAfterCallback: true,
		  callback: function (e) { 
			$('.fr-view').find("a").each(function(){
				$(this).removeAttr("href"); // remove href
                                //$(this).remove(); // remove [a] tag
			});
		  }
    });


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants