mirror of
https://github.com/logseq/logseq.git
synced 2026-05-24 12:44:22 +00:00
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user