Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 480 Vote(s) - 3.58 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Prevent TinyMCE/Internet Explorer from converting URLs to links

#1
I'm using TinyMCE to provide users the capability of simple text formatting (bold, italics, lists) on a textarea form field. Everthing is working properly except that in Internet Explorer (8 but I've read it happens on earlier versions), when users type a URL (e.g. www.google.com) it is automatically converted into an HTML link in the TinyMCE editor as they type. This does not happen in Firefox (3). How can I prevent IE from doing this?

I've initialized TinyMCE with the following:

tinyMCE.init({
mode : "textareas",
theme : "simple",
convert_urls : false
});

But I don't think convert_urls is intended to affect the behavior I'm describing:

[To see links please register here]


I tried:

function myCustomURLConverter(url, node, on_save) {
return url;
}

tinyMCE.init({
mode : "textareas",
theme : "simple",
urlconverter_callback : "myCustomURLConverter"
});

But similarly I think this is just a way to affect how/whether URLs are converted upon load/save, not to prevent them from being converted to links as users type:

[To see links please register here]


The issue I'm trying to fix is described in at least a couple of places:

[To see links please register here]

(third post, by tommya)

[To see links please register here]


Has anyone seen this before or have any suggestions on how to fix it? The TinyMCE code-base is pretty big and difficult to trace so I was hoping someone could help me isolate the issue a bit.
Reply

#2
Doesn't seem to be a way to disable that in IE. It seems to be a 'feature' and it occurs on FCKEditor too. A couple alternatives, remove the <a> element out of the valid elements.

[To see links please register here]


Or do a serverside <a> tag parse to remove it.

I think this may be the 'feature'

[To see links please register here]


And here maybe a hint in getting it to work, but it looked like ActiveX and VB so I got lost pretty quick in my experiment

[To see links please register here]

Reply

#3
Here's a working workaround, needing the paste plugin.
In your TinyMCE init config, add :

paste_preprocess : function(pl, o) {
// Strip <a> HTML tags from clipboard content (Happens on Internet Explorer)
o.content = o.content.replace( /(\s[a-z]+=")<a\s[^>]+>([^<]+)<\/a>/gi, '$1$2' );
}

Reply

#4
I think I solved it this way:

remove_script_host: "false",
relative_urls: "false",
document_base_url : "http//www.mywebsite.nlhttp://www.mywebsite.nl",

Reply

#5
I've solved this problem with these configs:


remove_script_host : false,
auto_cleanup_word : false,
relative_urls : false,
convert_urls : false,
verify_html : false,
convert_newlines_to_brs : false,
urlconvertor_callback: "convLinkVC",
document_base_url : "",
forced_root_block : '',
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through