From beb02b6028fa3607930c1ae83b949ee8c8dbd9bb Mon Sep 17 00:00:00 2001 From: Andelf Date: Wed, 19 Apr 2023 22:49:51 +0800 Subject: [PATCH] fix(editor): wrong xml prettify implementation Introduced: #8968 --- src/main/frontend/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/utils.js b/src/main/frontend/utils.js index e7fd2dd571..d111db15b7 100644 --- a/src/main/frontend/utils.js +++ b/src/main/frontend/utils.js @@ -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('