Open MaxPerl opened 6 years ago
Okay, I found the error. It was a simple misspelling in html function of the BBCode object:
return '<img title="' + content + ' src="' + src + '" />';
must be
return '<img title="' + content + '"(!!!!) src="' + src + '" />';
Now I have another problem. The image is only shown if I toogle to SourceMode and back to WYSIWYG mode. I could solve this with a little hack in the command setting:
$.sceditor.command.set("image-new", {
[...]
$('<p><button>Add image</button></p>')
.click(function (e) {
var src = $("#sceditor-image-src").val();
var title = $("#sceditor-image-title").val();
editor.insert("[img=" + src + "]" + title + "[/img]");
// A very dirty hack.. Otherwise the image is not shown!!!
editor.toggleSourceMode;
editor.toggleSourceMode;
editor.closeDropDown(true);
e.preventDefault();
}) [...]
But this cannot be the right soution???
Hello, First thank you very much for your wonderful editor. Unfortunately I don't accomplish to create a custom image tag. I want the following form:
[img=/path/to/image.png]Title/alternative Text[/img].
At the moment I tried this:
Unfortunately the image tag get lost after switching to/from Source editor. And also in HTML View the image isn't shown but only the BBCode text.
Could anyone help me?
Thanks in advance, Max