开发者

Internet Explorer Email Address Autolink -- Disable?

开发者 https://www.devze.com 2023-02-09 13:43 出处:网络
I\'m trying to use a component called Codemirror for in-browser source code editing. It works great, but IE7 has a bug (feature?) that autolinks all email addr开发者_运维问答esses that are typed into

I'm trying to use a component called Codemirror for in-browser source code editing. It works great, but IE7 has a bug (feature?) that autolinks all email addr开发者_运维问答esses that are typed into the code editing window.

For example, if I type String x = "me@mydomain.com";, IE turns this into String x = me@mydomain.com; -- it strips the quotes and underlines it.

Does anyone know how to override or disable this? Thank you.

-tjw


I have heard about Codemirror, but I did not used it yet, have you tried:

· Changing the @ for @?

· Adding a part of the string to the other?

· Parsing the final result to String again?


Using single quotes instead of double should work. I've tested it in IE8 and IE9 RC1.


I presume the component is using a Web Browser Control under the covers, which seems like an odd choice. You can prevent automatic hyperlink generation using ExecCommand(IDM_AUTOURLDETECT_MODE); see http://msdn.microsoft.com/en-us/library/aa769893(v=vs.85).aspx

Prior to IE9, it was not possible to specify IDM_AUTOURLDETECT_MODE from JavaScript, meaning that pages could not disable automatic hyperlinking in ContentEditable areas. A new command constant AutoUrlDetect is supported in IE9, allowing script to disable automatic hyperlinking as follows: document.execCommand("AutoUrlDetect", false, false)

0

精彩评论

暂无评论...
验证码 换一张
取 消