Its possible with TinyMCE to define custom URL converter logic as defined in this page. Using the url_converter callback you can define a JavaScript function that will handle URL conversions. The documentation mentions that within your custom code you are able to make calls to the default convertURL function to fall back on the default logic in certain cases. However, it appears that making calls to this function in turn creates calls to the custom function and creates an infinite loop. Either the documentation is wrong or I’m implementing incorrectly, any ideas?
This is a partial of what i’m using at the moment:
function myCustomURLConverter(url, node, on_save) {
// just calls myCustomURLConverter again
var url = tinyMCE.activeEditor.Editor.prototype.convertURL(url, node, on_save);
}
tinyMCE.init({
urlconverter_callback : "myCustomURLConverter"
});
It seemes the solution is a hack onto the convertURL function: