Fix issue in diffMarked creating text nodes for each character

This commit is contained in:
yflory 2017-10-31 18:19:30 +01:00
parent 5438970ab4
commit 3ebb5ca493
2 changed files with 2 additions and 1 deletions

View File

@ -129,6 +129,7 @@ define([
var domFromHTML = function (html) { var domFromHTML = function (html) {
var Dom = new DOMParser().parseFromString(html, "text/html"); var Dom = new DOMParser().parseFromString(html, "text/html");
Dom.normalize();
removeForbiddenTags(Dom.body); removeForbiddenTags(Dom.body);
removeListeners(Dom.body); removeListeners(Dom.body);
return Dom; return Dom;
@ -179,6 +180,7 @@ define([
var $div = $('<div>', {id: id}).append(safe_newHtmlFixed); var $div = $('<div>', {id: id}).append(safe_newHtmlFixed);
var Dom = domFromHTML($('<div>').append($div).html()); var Dom = domFromHTML($('<div>').append($div).html());
$content[0].normalize();
var oldDom = domFromHTML($content[0].outerHTML); var oldDom = domFromHTML($content[0].outerHTML);
var patch = makeDiff(oldDom, Dom, id); var patch = makeDiff(oldDom, Dom, id);
if (typeof(patch) === 'string') { if (typeof(patch) === 'string') {

View File

@ -402,7 +402,6 @@ define([
}); });
framework.setContentGetter(function () { framework.setContentGetter(function () {
console.log(framework._.title.title);
var content = CodeMirror.getContent(); var content = CodeMirror.getContent();
Slide.update(content.content); Slide.update(content.content);
return content; return content;