TinyMCE 中的自定义 URL 转换器逻辑
使用 TinyMCE 可以定义自定义 URL 转换器逻辑,如本页中所定义。使用 url_converter
回调,您可以定义一个处理 URL 转换的 JavaScript 函数。该文档提到,在自定义代码中,您可以调用默认的 ConvertURL 函数,以在某些情况下依靠默认逻辑。但是,调用此函数似乎会依次创建对自定义函数的调用并创建无限循环。要么文档错误,要么我实施不正确,有什么想法吗?
这是我目前正在使用的部分内容:
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"
});
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"
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案似乎是对 ConvertURL 函数的破解:
It seemes the solution is a hack onto the convertURL function: