Unescape HTML escape sequences in the uploaded annotation XML file (#346)

main
kshramt 7 years ago committed by Nikita Manovich
parent 9ecc5a9948
commit 5f0c26e82f

@ -93,7 +93,7 @@ class AnnotationParser {
throw Error('An unknown attribute found in the annotation file: ' + name);
}
let attrInfo = this._labelsInfo.attrInfo(attrId);
let value = this._labelsInfo.strToValues(attrInfo.type, attrTag.innerHTML)[0];
let value = this._labelsInfo.strToValues(attrInfo.type, attrTag.textContent)[0];
if (['select', 'radio'].includes(attrInfo.type) && !attrInfo.values.includes(value)) {
throw Error('Incorrect attribute value found for "' + name + '" attribute: ' + value);

@ -279,7 +279,7 @@ qUnitTests.push(function() {
<attribute name="false_positive">false</attribute>
<attribute name="age">25</attribute>
<attribute name="gender">female</attribute>
<attribute name="clother">non-initialized</attribute>
<attribute name="clother">non-initialized&amp;&lt;&gt;</attribute>
<attribute name="action">standing</attribute>
</polygon>
<polygon label="person" points="1064.14,997.18;1368.70,1185.26;1746.24,1071.57;1377.12,894.73" occluded="0" z_order="11">
@ -640,7 +640,7 @@ window.jobData = {
"value": "female"
}, {
"id": "34",
"value": "non-initialized"
"value": "non-initialized&<>"
}, {
"id": "35",
"value": "standing"

Loading…
Cancel
Save