Fixed property names not being escaped when rendering

This commit is contained in:
jos 2016-08-26 12:25:51 +02:00
parent 7280239771
commit 9350debba2
1 changed files with 5 additions and 1 deletions

View File

@ -175,12 +175,14 @@ export default class JSONNode extends Component {
}, prop)
}
else { // object property
const escapedProp = escapeHTML(prop)
return h('div', {
class: 'jsoneditor-property' + (prop.length === 0 ? ' jsoneditor-empty' : ''),
contentEditable: 'true',
spellCheck: 'false',
onBlur: this.handleChangeProperty
}, prop)
}, escapedProp)
}
}
else {
@ -520,12 +522,14 @@ export default class JSONNode extends Component {
const parentPath = this.props.parent.getPath()
const oldProp = this.props.prop
const newProp = unescapeHTML(getInnerText(event.target))
console.log('newProp', newProp)
this.props.events.onChangeProperty(parentPath, oldProp, newProp)
}
handleChangeValue (event) {
const value = this._getValueFromEvent(event)
console.log('value', value)
this.props.events.onChangeValue(this.getPath(), value)
}