diff --git a/e107_plugins/tinymce/plugins/e107bbcode/editor_plugin.js b/e107_plugins/tinymce/plugins/e107bbcode/editor_plugin.js
index 74a5b0226..4fe306240 100644
--- a/e107_plugins/tinymce/plugins/e107bbcode/editor_plugin.js
+++ b/e107_plugins/tinymce/plugins/e107bbcode/editor_plugin.js
@@ -83,9 +83,11 @@
// New Image Handler // verified
- // rep(//gi,"[img style=$1;width:$4px;height:$5px]$2[/img]" )
- rep(/
/gi,"[img style=$1;width:$4px;height:$5px]$2[/img]" );
- rep(/;width:px;height:px/gi, ""); // Img cleanup.
+ // rep(/
/gi,"[img style=$1;width:$4px;height:$5px]$2[/img]" );
+
+ //rep(/
/gi,"[img style=$1;width:$4px;height:$5px]$2[/img]" )
+ rep(/
/gm,"[img style=width:$4px;height:$5px;$1]$2[/img]" );
+ rep(/;width:px;height:px/gi, ""); // Img cleanup.
// rep(/
/gi,"[img]$1[/img]");
rep(/
]*>/gi,"[blockquote]"); @@ -196,6 +198,11 @@ rep(/\[link=([^\]]+)\](.*?)\[\/link\]/gi,"$2"); rep(/\[url\](.*?)\[\/url\]/gi,"$1"); // rep(/\[img.*?style=(.*?).*?\](.*?)\[\/img\]/gi,""); + + // When Width and Height are present: + rep(/\[img\s*?style=(?:width:(\d*)px;height:(\d*)px;)([^\]]*)]([\s\S]*?)\[\/img]/gm, "
"); + + // No width/height but style is present rep(/\[img\s*?style=([^\]]*)]([\s\S]*?)\[\/img]/gi,"
"); rep(/\[img\](.*?)\[\/img\]/gi,"
");