Naveen K
Naveen K

Reputation: 889

how to disable the url in ckeditor plugin?

I am using CKEditor plugin for textarea.

I don't want any urls in that text. I don't know how to identify if text contains any urls or hyperlinks. Is there any way to do this? For example my code is as follows:

text = "hi <br> this is something about <br> www.google.com. such a good web site. <br> <a href='www.google.com'>click</a> to go <br>";

I need to identify urls and href in above code.

Upvotes: 1

Views: 3736

Answers (1)

oleq
oleq

Reputation: 15895

If you want to disable links in CKEditor, use the latest 4.1.x build and take the advantage of the Advanced Content Filter (ACF).

You can either basically remove link plugin by specifying config.removePlugins = 'link' in your config or restrict config.allowedContent to not to accept <a> tags (see ACF configuration guide).

This will inform your editor that links are undesired and they'll be stripped out on the editor's output.

Upvotes: 1

Related Questions