Skip to content

Commit

Permalink
Fix issue kindsoft#32
Browse files Browse the repository at this point in the history
  • Loading branch information
luolonghao committed Aug 30, 2012
1 parent 5743bca commit d3d6980
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions kindeditor-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions kindeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Roddy <[email protected]>
* @website http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php
* @version 4.1.2 (2012-08-10)
* @version 4.1.2 (2012-08-30)
*******************************************************************************/
(function (window, undefined) {
if (window.KindEditor) {
Expand All @@ -17,7 +17,7 @@ if (!window.console) {
if (!console.log) {
console.log = function () {};
}
var _VERSION = '4.1.2 (2012-08-10)',
var _VERSION = '4.1.2 (2012-08-30)',
_ua = navigator.userAgent.toLowerCase(),
_IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1,
_GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1,
Expand Down Expand Up @@ -5768,7 +5768,7 @@ _plugin('core', function(K) {
return '<noscript' + unescape(attr) + '>' + unescape(code) + '</noscript>';
})
.replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig, function(full, start, src, end) {
full = full.replace(/(\s+(?:href|src)=")[^"]*(")/i, '$1' + src + '$2');
full = full.replace(/(\s+(?:href|src)=")[^"]*(")/i, '$1' + unescape(src) + '$2');
full = full.replace(/\s+data-ke-src="[^"]*"/i, '');
return full;
})
Expand Down Expand Up @@ -5801,7 +5801,7 @@ _plugin('core', function(K) {
if (full.match(/\sdata-ke-src="[^"]*"/i)) {
return full;
}
full = start + key + '="' + src + '"' + ' data-ke-src="' + src + '"' + end;
full = start + key + '="' + src + '"' + ' data-ke-src="' + escape(src) + '"' + end;
return full;
})
.replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig, function(full, start, end) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ _plugin('core', function(K) {
return '<noscript' + unescape(attr) + '>' + unescape(code) + '</noscript>';
})
.replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig, function(full, start, src, end) {
full = full.replace(/(\s+(?:href|src)=")[^"]*(")/i, '$1' + src + '$2');
full = full.replace(/(\s+(?:href|src)=")[^"]*(")/i, '$1' + unescape(src) + '$2');
full = full.replace(/\s+data-ke-src="[^"]*"/i, '');
return full;
})
Expand Down Expand Up @@ -1500,7 +1500,7 @@ _plugin('core', function(K) {
if (full.match(/\sdata-ke-src="[^"]*"/i)) {
return full;
}
full = start + key + '="' + src + '"' + ' data-ke-src="' + src + '"' + end;
full = start + key + '="' + src + '"' + ' data-ke-src="' + escape(src) + '"' + end;
return full;
})
.replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig, function(full, start, end) {
Expand Down
2 changes: 2 additions & 0 deletions test/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ KindEditor.ready(function (K) {
equals(editor.html(), '<p> abc</p>');
editor.html('<noscript><img src="" /></noscript>');
equals(editor.html(), '<noscript><img src="" /></noscript>');
editor.html('<a href="test.php?id=1&name=test">test</a>');
equals(editor.html(), '<a href="test.php?id=1&name=test">test</a>');
});

test("editor.text", function() {
Expand Down

0 comments on commit d3d6980

Please sign in to comment.