|
|
@@ -2,8 +2,9 @@
|
|
|
import pako from 'pako';
|
|
|
import xmldoc from 'xmldoc';
|
|
|
|
|
|
+const unconpressedDataRegexp = new RegExp('<mxGraphModel');
|
|
|
const validateUncompressedData = (input: string): boolean => {
|
|
|
- return new RegExp('/<mxGraphModel/').test(input);
|
|
|
+ return unconpressedDataRegexp.test(input);
|
|
|
};
|
|
|
|
|
|
const validateCompressedData = (input: string): boolean => {
|
|
|
@@ -60,7 +61,7 @@ export const generateMxgraphData = (code: string): string => {
|
|
|
// Evaluate the code is whether uncompressed data that are generated by v21.1.0 or above
|
|
|
// see: https://github.com/jgraph/drawio/issues/3106#issuecomment-1479352026
|
|
|
const isUncompressedData = validateUncompressedData(trimedCode);
|
|
|
- if (isUncompressedData) {
|
|
|
+ if (!isUncompressedData) {
|
|
|
validateCompressedData(trimedCode);
|
|
|
}
|
|
|
|