diff --git a/www/extras/yui-webgui/build/code-editor/code-editor.js b/www/extras/yui-webgui/build/code-editor/code-editor.js index 74e661780..371de754b 100755 --- a/www/extras/yui-webgui/build/code-editor/code-editor.js +++ b/www/extras/yui-webgui/build/code-editor/code-editor.js @@ -212,7 +212,7 @@ this._getSelection().getRangeAt(0).insertNode(this._getDoc().createTextNode(this.cc)); } else if (this.browser.webkit || this.browser.ie || this.browser.opera) { try { - this.execCommand('inserthtml', ''); + this.execCommand('inserthtml', this.cc); } catch (e) {} } @@ -228,7 +228,7 @@ html = html.replace(/
/ig, '
'); html = html.replace(/
/ig, '
'); html = html.replace(/
/ig,'\n'); - html = html.replace(/<.*?>/g,''); + html = html.replace(/<[^>]*>/g,''); html = html.replace(/\r?\n/g,'
'); //YAHOO.log('2: ' + html); } else { @@ -237,18 +237,24 @@ } YAHOO.log(html); //   before
for IE7 - html = html.replace(/( |<\/span>)?]*>/gi,'$1\n'); + html = html.replace(/( )?]*>/gi,'$1\n'); + html = html.replace(/<\/div>/ig, ''); + html = html.replace(/
/ig, '
'); + html = html.replace(/
/ig, '
'); + html = html.replace(/
/ig,'\n'); html = html.replace(/<[^>]*>/g,''); html = html.replace(/\r?\n/g,'
'); //   between
for IE6 - html = html.replace(/]*>(<\/span>)?]*>/gi, '
$1 
'); + html = html.replace(/]*>]*>/gi, '
$1 
'); YAHOO.log(html); } for (var i = 0; i < this.keywords.length; i++) { html = html.replace(this.keywords[i].code, this.keywords[i].tag); } YAHOO.log("AFTER HIGHLIGHT:" + html); - html = html.replace('', '|'); + if ( !this.browser.gecko ) { + html = html.replace(this.cc, '|'); + } this._getDoc().body.innerHTML = html; if (!focus) {