Fix html escaping and flyouts opening

This commit is contained in:
Rachel Fenichel
2017-12-07 16:08:00 -08:00
parent 9d71c972cb
commit 05351569c5
2 changed files with 7 additions and 2 deletions

View File

@@ -695,7 +695,12 @@ Blockly.Block.prototype.getVarModels = function() {
for (var i = 0, input; input = this.inputList[i]; i++) {
for (var j = 0, field; field = input.fieldRow[j]; j++) {
if (field instanceof Blockly.FieldVariable) {
vars.push(this.workspace.getVariableById(field.getValue()));
var model = this.workspace.getVariableById(field.getValue());
// Check if the variable actually exists (and isn't just a potential
// variable).
if (model) {
vars.push(model);
}
}
}
}

View File

@@ -336,7 +336,7 @@ Blockly.Variables.generateVariableFieldXml_ = function(variableModel) {
}
var text = '<field name="VAR" id="' + variableModel.getId() +
'" variabletype="' + typeString +
'">' + variableModel.name + '</field>';
'">' + goog.string.htmlEscape(variableModel.name) + '</field>';
return text;
};