From ec64e0d3816a9999b7f6d330e1f114b9411b40f0 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 7 Apr 2016 15:55:57 +0200 Subject: [PATCH] use getAttribute to inspect document elements el.getAttribute('attr') is more reliable than el[attr]. --- www/_socket/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/_socket/main.js b/www/_socket/main.js index 3b2095be4..e943aa949 100644 --- a/www/_socket/main.js +++ b/www/_socket/main.js @@ -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...