mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-25 07:22:33 -05:00
Merge pull request #1235 from kchadha/xml-escape-comments
XML escape comment text.
This commit is contained in:
commit
529d271186
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
const uid = require('../util/uid');
|
const uid = require('../util/uid');
|
||||||
const Cast = require('../util/cast');
|
const Cast = require('../util/cast');
|
||||||
|
const xmlEscape = require('../util/xml-escape');
|
||||||
|
|
||||||
class Comment {
|
class Comment {
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +32,7 @@ class Comment {
|
||||||
toXML () {
|
toXML () {
|
||||||
return `<comment id="${this.id}" x="${this.x}" y="${
|
return `<comment id="${this.id}" x="${this.x}" y="${
|
||||||
this.y}" w="${this.width}" h="${this.height}" pinned="${
|
this.y}" w="${this.width}" h="${this.height}" pinned="${
|
||||||
this.blockId !== null}" minimized="${this.minimized}">${this.text}</comment>`;
|
this.blockId !== null}" minimized="${this.minimized}">${xmlEscape(this.text)}</comment>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO choose min and defaults for width and height
|
// TODO choose min and defaults for width and height
|
||||||
|
|
Loading…
Reference in a new issue