use getAttribute to inspect document elements
el.getAttribute('attr') is more reliable than el[attr].pull/1/head
parent
f5b0e1a5df
commit
ec64e0d381
|
@ -36,7 +36,8 @@ define([
|
|||
var isNotMagicLine = function (el) {
|
||||
// factor as:
|
||||
// return !(el.tagName === 'SPAN' && el.contentEditable === 'false');
|
||||
var filter = (el.tagName === 'SPAN' && el.contentEditable === 'false');
|
||||
var filter = (el.tagName === 'SPAN' &&
|
||||
el.getAttribute('contentEditable') === 'false');
|
||||
if (filter) {
|
||||
console.log("[hyperjson.serializer] prevented an element" +
|
||||
"from being serialized:", el);
|
||||
|
@ -97,7 +98,7 @@ define([
|
|||
we should check when such an element is going to be
|
||||
removed, and prevent that from happening. */
|
||||
if (info.node && info.node.tagName === 'SPAN' &&
|
||||
info.node.contentEditable === "true") {
|
||||
info.node.getAttribute('contentEditable') === "false") {
|
||||
// it seems to be a magicline plugin element...
|
||||
if (info.diff.action === 'removeElement') {
|
||||
// and you're about to remove it...
|
||||
|
|
Loading…
Reference in New Issue