mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Fix serialization of blockInfo mutation property to XML
This commit is contained in:
parent
a27ea76d25
commit
297047a6b9
1 changed files with 7 additions and 1 deletions
|
@ -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 += '>';
|
||||
|
|
Loading…
Reference in a new issue