Avoid transformation text to link ie contentEditab

2019-02-17 00:26发布

问题:

In contenteditable div, in IE text like "http://blablabla", "www.blablabla", "bla@blabla" and so on automatically transforms into hyperlinks http://blablabla, www.blablabla, bla@blabla. How can I avoid this?

回答1:

Unfortunately, there is no cross-version solution. In IE9 there is opportunity, allowing to disable automatic hyperlinking:

document.execCommand("AutoUrlDetect", false, false);

More information: http://msdn.microsoft.com, http://bytes.com