From 4412a2ace4def3e8b5dc899336555de9b0182bca Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Sat, 26 Sep 2020 01:11:31 +0300
Subject: [PATCH] after save change back

---
 wax-prosemirror-core/src/Wax.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/wax-prosemirror-core/src/Wax.js b/wax-prosemirror-core/src/Wax.js
index 6c5c30e87..0cc74c051 100644
--- a/wax-prosemirror-core/src/Wax.js
+++ b/wax-prosemirror-core/src/Wax.js
@@ -94,7 +94,7 @@ const Wax = props => {
 
   const finalOnChange = debounce(
     value => {
-      /* HACK alter toDOM of footnote, because of how PM treats inline nodes
+      /*HACK  alter toDOM of footnote, because of how PM treats inline nodes
       with content */
       if (schema.nodes.footnote) {
         const old = schema.nodes.footnote.spec.toDOM;
@@ -106,6 +106,14 @@ const Wax = props => {
 
       const serialize = serializer(schema);
       WaxOnchange(serialize(value));
+
+      if (schema.nodes.footnote) {
+        const old = schema.nodes.footnote.spec.toDOM;
+        schema.nodes.footnote.spec.toDOM = function (node) {
+          old.apply(this, arguments);
+          return ['footnote', node.attrs];
+        };
+      }
     },
     1000,
     { maxWait: 5000 },
-- 
GitLab