Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/443.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在ckeditor插件中禁用url?_Javascript_Ckeditor - Fatal编程技术网

Javascript 如何在ckeditor插件中禁用url?

Javascript 如何在ckeditor插件中禁用url?,javascript,ckeditor,Javascript,Ckeditor,我正在为textarea使用CKEditor插件 我不希望在该文本中有任何URL。我不知道如何识别文本是否包含任何URL或超链接。有没有办法做到这一点?例如,我的代码如下所示: 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 &l

我正在为textarea使用CKEditor插件

我不希望在该文本中有任何URL。我不知道如何识别文本是否包含任何URL或超链接。有没有办法做到这一点?例如,我的代码如下所示:

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>";
text=“hi
这是关于
www.google.com的内容。这是一个非常好的网站;

我需要在上面的代码中识别URL和
href

如果要禁用CKEditor中的链接,请使用并利用

您可以通过在配置中指定
config.removePlugins='link'
基本上删除链接插件,或者限制
config.allowedContent
不接受


这将通知您的编辑器不需要链接,它们将在编辑器的输出中被删除。

如果要在CKEditor中禁用链接,请使用并利用

您可以通过在配置中指定
config.removePlugins='link'
基本上删除链接插件,或者限制
config.allowedContent
不接受


这将通知您的编辑器不需要链接,它们将在编辑器的输出中删除。

您需要使用正则表达式。如果您使用jQuery,那么删除文本中的所有锚定标记是非常容易的
.find()
可用于此目的。要搜索字符串中的URL,必须使用regex。您的意思是要禁用CKEditor中的链接吗?无法粘贴或创建它们?是的,我想在CKEditor中禁用链接和URL…您需要使用正则表达式。如果您使用jQuery,那么删除文本中的所有锚定标记是非常容易的
.find()
可用于此目的。要搜索字符串中的URL,必须使用regex。您的意思是要禁用CKEditor中的链接吗?无法粘贴或创建它们?是的,我想在CKEditor中禁用链接和URL。。。