mirror of https://github.com/xwiki-labs/cryptpad
Fix issue in diffMarked creating text nodes for each character
This commit is contained in:
parent
5438970ab4
commit
3ebb5ca493
|
@ -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') {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue