XML escape comment text.

This commit is contained in:
Karishma Chadha 2018-06-14 11:39:03 -04:00
parent f5234c777a
commit 0d403d8e83

View file

@ -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