Skip to content

Commit

Permalink
fix(editor): wrong xml prettify implementation
Browse files Browse the repository at this point in the history
Introduced: #8968
  • Loading branch information
andelf committed Apr 19, 2023
1 parent 897a6af commit 87f7cfe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/frontend/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,5 +395,7 @@ export const prettifyXml = function(sourceXml)
xsltProcessor.importStylesheet(xsltDoc);
var resultDoc = xsltProcessor.transformToDocument(xmlDoc);
var resultXml = new XMLSerializer().serializeToString(resultDoc);
return resultXml;
// if it has parsererror, then return the original text
return resultXml.indexOf('<parsererror') === -1 ? resultXml : sourceXml;

};

0 comments on commit 87f7cfe

Please sign in to comment.