From b7fa2669a88c10e8a59910652c6fb0a33ffddf51 Mon Sep 17 00:00:00 2001 From: Nemanja Karadzic Date: Thu, 9 Oct 2014 21:00:34 +0200 Subject: [PATCH] Added check for "convert_urls" in TinyMCE config. --- javascript/HtmlEditorField.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index 9fd1f8487..ad12b58e8 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -213,11 +213,12 @@ ss.editorWrappers.tinyMCE = (function() { * {DOMElement} */ cleanLink: function(href, node) { - var cb = tinyMCE.settings['urlconverter_callback']; + var cb = tinyMCE.settings['urlconverter_callback'], + cu = tinyMCE.settings['convert_urls']; if(cb) href = eval(cb + "(href, node, true);"); - // Turn into relative - if(href.match(new RegExp('^' + tinyMCE.settings['document_base_url'] + '(.*)$'))) { + // Turn into relative, if set in TinyMCE config + if(cu && href.match(new RegExp('^' + tinyMCE.settings['document_base_url'] + '(.*)$'))) { href = RegExp.$1; }