mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-30 16:10:08 -04:00
use xmlEscape instead of escape-html for extensions
This commit is contained in:
parent
cc75154f9a
commit
a308b1e02f
4 changed files with 5 additions and 6 deletions
3
package-lock.json
generated
3
package-lock.json
generated
|
@ -3865,7 +3865,8 @@
|
|||
"escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
|
||||
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
|
||||
"dev": true
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
"canvas-toBlob": "1.0.0",
|
||||
"decode-html": "2.0.0",
|
||||
"diff-match-patch": "1.0.4",
|
||||
"escape-html": "1.0.3",
|
||||
"format-message": "6.2.1",
|
||||
"htmlparser2": "3.10.0",
|
||||
"immutable": "3.8.1",
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const EventEmitter = require('events');
|
||||
const {OrderedMap} = require('immutable');
|
||||
const escapeHtml = require('escape-html');
|
||||
|
||||
const ArgumentType = require('../extension-support/argument-type');
|
||||
const Blocks = require('./blocks');
|
||||
|
@ -15,6 +14,7 @@ const log = require('../util/log');
|
|||
const maybeFormatMessage = require('../util/maybe-format-message');
|
||||
const StageLayering = require('./stage-layering');
|
||||
const Variable = require('./variable');
|
||||
const xmlEscape = require('../util/xml-escape');
|
||||
|
||||
// Virtual I/O devices.
|
||||
const Clock = require('../io/clock');
|
||||
|
@ -747,7 +747,7 @@ class Runtime extends EventEmitter {
|
|||
* @private
|
||||
*/
|
||||
_makeExtensionMenuId (menuName, extensionId) {
|
||||
return `${extensionId}_menu_${escapeHtml(menuName)}`;
|
||||
return `${extensionId}_menu_${xmlEscape(menuName)}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1207,7 +1207,7 @@ class Runtime extends EventEmitter {
|
|||
|
||||
const defaultValue =
|
||||
typeof argInfo.defaultValue === 'undefined' ? '' :
|
||||
escapeHtml(maybeFormatMessage(argInfo.defaultValue, this.makeMessageContextForTarget()).toString());
|
||||
xmlEscape(maybeFormatMessage(argInfo.defaultValue, this.makeMessageContextForTarget()).toString());
|
||||
|
||||
if (argTypeInfo.check) {
|
||||
argJSON.check = argTypeInfo.check;
|
||||
|
|
|
@ -72,7 +72,6 @@ module.exports = [
|
|||
},
|
||||
externals: {
|
||||
'decode-html': true,
|
||||
'escape-html': true,
|
||||
'format-message': true,
|
||||
'htmlparser2': true,
|
||||
'immutable': true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue