Skip to content

Commit

Permalink
修复‘>’和‘<’被转义。
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 4, 2015
1 parent 285b0d3 commit 0e02227
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build/MDEditor.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,8 @@
MDEditor.prototype.load = function() {
var self = this, box = self.obj[0], index = 0;
if (box) {
if (box.innerHTML !== "") self.opts.value = box.innerHTML, box.innerHTML = "";
if (box.innerHTML !== "") self.opts.value = box.innerHTML.replace(/\&gt\;/g, ">").replace(/\&lt\;/g, ">"),
box.innerHTML = "";
box.appendChild(self.preview), box.appendChild(self.tools), box.appendChild(self.textarea);
}
self.setMD();
Expand Down
5 changes: 4 additions & 1 deletion lib/MDEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@
var self = this,box = self.obj[0],index=0;

if(box) {
if(box.innerHTML!=="") self.opts.value = box.innerHTML,
if(box.innerHTML!=="")
self.opts.value = box.innerHTML
.replace(/\&gt\;/g,'>')
.replace(/\&lt\;/g,'>'),
box.innerHTML='';
box.appendChild(self.preview),
box.appendChild(self.tools),
Expand Down

0 comments on commit 0e02227

Please sign in to comment.