[refs #616] ugly replaces

This commit is contained in:
Alexander Machehin 2012-09-20 23:10:50 +06:00
parent 1dcce7bf92
commit 378fe5847e
3 changed files with 3 additions and 3 deletions

View File

@ -83,6 +83,6 @@ $(document).ready(function() {
});
$('.md_and_cm code').each(function (code) {
CodeMirror.runMode(this.innerHTML.replace(/&/gi, '&'), this.className, this);
CodeMirror.runMode(this.innerHTML.replace(/&amp;/gi, '&').replace(/&lt;/gi, '<').replace(/&gt;/gi, '>'), this.className, this);
});
});

View File

@ -21,7 +21,7 @@ $(document).ready(function() {
var cancel_button = form.find('.cancel_edit_comment.button');
cancel_button.click();
$('.buttons a.edit_comment#'+cancel_button.attr('id')).parent().parent().find('.cm-s-default.md_and_cm').html(data).find('code').each(function (code) {
CodeMirror.runMode(this.innerHTML.replace(/&amp;/gi, '&'), this.className, this);
CodeMirror.runMode(this.innerHTML.replace(/&amp;/gi, '&').replace(/&lt;/gi, '<').replace(/&gt;/gi, '>'), this.className, this);
});
},
error: function(data){

View File

@ -16,7 +16,7 @@ $(document).ready(function() {
data: el_dup.serialize(),
success: function(data){
preview.html(data).find('code').each(function (code) {
CodeMirror.runMode(this.innerHTML.replace(/&amp;/gi, '&'), this.className, this);
CodeMirror.runMode(this.innerHTML.replace(/&amp;/gi, '&').replace(/&lt;/gi, '<').replace(/&gt;/gi, '>'), this.className, this);
});
},
error: function(data){