diff --git a/lib/editor/htmlarea.php b/lib/editor/htmlarea.php
index 104b8c69e53..d6392c43e43 100644
--- a/lib/editor/htmlarea.php
+++ b/lib/editor/htmlarea.php
@@ -1321,14 +1321,17 @@ HTMLArea.prototype._createLink = function(link) {
if (typeof link == "undefined") {
link = this.getParentElement();
if (link && !/^a$/i.test(link.tagName)) {
- link = null;
- var sel = this._getSelection();
- var rng = this._createRange(sel);
- var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
- if(len < 1) {
- alert("You must select text first!");
- return false;
+ if(link.tagName.toLowerCase() != 'img') {
+ link = null;
+ var sel = this._getSelection();
+ var rng = this._createRange(sel);
+ var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
+ if(len < 1) {
+ alert("You must select text first!");
+ return false;
+ }
}
+ link = null;
}
}
if (link) {
diff --git a/lib/weblib.php b/lib/weblib.php
index 93871024ae8..19d590d139a 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -2607,8 +2607,6 @@ function print_speller_code ($usehtmleditor=false) {
echo "\tspeller._editor=editor;\n";
echo "\tspeller.openChecker();\n";
echo "}\n";
- echo "config.registerButton(\"spell-check\", \"spell-check\", \"". $CFG->wwwroot ."/lib/speller/spell.gif\", false, spellClickHandler);\n";
- echo "config.toolbar.push([\"spell-check\"]);\n";
}
}