From 297047a6b929f1c7ced03a7ea2a9464094758ccc Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Tue, 23 Apr 2019 11:44:45 -0400 Subject: [PATCH] Fix serialization of blockInfo mutation property to XML --- src/engine/blocks.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engine/blocks.js b/src/engine/blocks.js index db0d5a5bc..165d5096c 100644 --- a/src/engine/blocks.js +++ b/src/engine/blocks.js @@ -1108,8 +1108,14 @@ class Blocks { let mutationString = `<${mutation.tagName}`; for (const prop in mutation) { if (prop === 'children' || prop === 'tagName') continue; - const mutationValue = (typeof mutation[prop] === 'string') ? + let mutationValue = (typeof mutation[prop] === 'string') ? xmlEscape(mutation[prop]) : mutation[prop]; + + // Handle dynamic extension blocks + if (prop === 'blockInfo') { + mutationValue = xmlEscape(JSON.stringify(mutation[prop])); + } + mutationString += ` ${prop}="${mutationValue}"`; } mutationString += '>';