Skip to content

Commit

Permalink
fix: destructure NamedNodeMap so it can be merged
Browse files Browse the repository at this point in the history
  • Loading branch information
oatymart committed Feb 2, 2024
1 parent 07fd63b commit 3fde131
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions views/js/controller/creator/encoders/dom2qti.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ define([
nodeName = normalizeNodeName(elt.nodeName);

object = _.merge(qtiElementHelper.create(nodeName, {
'id': '',
'class': '',
'xmlBase': '',
'lang': '',
'label': ''
}),
_.transform(elt.attributes, function (acc, value) {
'id': '',
'class': '',
'xmlBase': '',
'lang': '',
'label': ''
}), {
...(_.transform(elt.attributes, function (acc, value) {
const attrName = normalizeNodeName(value.nodeName);
if (attrName) {
if (typedAttributes[nodeName] && typedAttributes[nodeName][attrName]) {
Expand All @@ -171,7 +171,8 @@ define([
acc[attrName] = value.nodeValue;
}
}
}));
}))
});
if (elt.childNodes.length > 0) {
object.content = self.decode(elt.childNodes);
}
Expand Down

0 comments on commit 3fde131

Please sign in to comment.