diff --git a/src/editors/containers/ProblemEditor/data/OLXParser.js b/src/editors/containers/ProblemEditor/data/OLXParser.js index cc00dab6e..7f4720b29 100644 --- a/src/editors/containers/ProblemEditor/data/OLXParser.js +++ b/src/editors/containers/ProblemEditor/data/OLXParser.js @@ -307,6 +307,14 @@ export class OLXParser { return _.map(questionObject, (obj) => _.mapKeys(obj, (value, key) => _.get(tagMap, key, key))); }; + // To be able to generate question's HTML, such that it respects the initial + // order of elements and styles stored in the OLX, we parse and build + // original `olxString` with `preserveOrder: true`. We parse and build the + // question separately, because the JSON structure produced with + // `preserveOrder: true` option is more complex and hard to work with, and + // since the order of nested elements is not important in other places, we + // restrict the complexity of the produced JSON within the scope of this + // method. const parser = new XMLParser({ preserveOrder: true, trimValues: false,