mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-11 21:43:58 -04:00
Decode the encoded argument information
This commit is contained in:
parent
63698dad8a
commit
80b4dab104
2 changed files with 3 additions and 1 deletions
|
@ -32,6 +32,7 @@
|
||||||
"babel-loader": "^7.0.0",
|
"babel-loader": "^7.0.0",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-es2015": "^6.24.1",
|
||||||
"copy-webpack-plugin": "4.2.1",
|
"copy-webpack-plugin": "4.2.1",
|
||||||
|
"decode-html": "2.0.0",
|
||||||
"escape-html": "1.0.3",
|
"escape-html": "1.0.3",
|
||||||
"eslint": "^4.5.0",
|
"eslint": "^4.5.0",
|
||||||
"eslint-config-scratch": "^5.0.0",
|
"eslint-config-scratch": "^5.0.0",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const html = require('htmlparser2');
|
const html = require('htmlparser2');
|
||||||
|
const decodeHtml = require('decode-html');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a part of a mutation DOM to a mutation VM object, recursively.
|
* Convert a part of a mutation DOM to a mutation VM object, recursively.
|
||||||
|
@ -11,7 +12,7 @@ const mutatorTagToObject = function (dom) {
|
||||||
obj.children = [];
|
obj.children = [];
|
||||||
for (const prop in dom.attribs) {
|
for (const prop in dom.attribs) {
|
||||||
if (prop === 'xmlns') continue;
|
if (prop === 'xmlns') continue;
|
||||||
obj[prop] = dom.attribs[prop];
|
obj[prop] = decodeHtml(dom.attribs[prop]);
|
||||||
}
|
}
|
||||||
for (let i = 0; i < dom.children.length; i++) {
|
for (let i = 0; i < dom.children.length; i++) {
|
||||||
obj.children.push(
|
obj.children.push(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue