Skip to content

Commit

Permalink
Make mapping code more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
JetSimon committed Sep 27, 2023
1 parent cb883a2 commit 8704ed9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ class TCTData {

getMapForPreview(svg) {

const pathsRegex = /<path((.|\n)*?)\/>/g;


const pathsRegex = /<path((.|\n)*?)(\/|<\/path)>/g;
const idRegex = / id[ \t]*=[ \t]*"(.*)"/g;
const dRegex = / d[ \t]*=[ \t]*"(.*)"/g;

Expand Down Expand Up @@ -448,7 +450,7 @@ class TCTData {

const svg = this.jet_data.mapping_data.mapSvg;

const pathsRegex = /<path((.|\n)*?)\/>/g;
const pathsRegex = /<path((.|\n)*?)(\/|<\/path)>/g;
const idRegex = / id[ \t]*=[ \t]*"(.*)"/g;
const dRegex = / d[ \t]*=[ \t]*"(.*)"/g;

Expand Down

0 comments on commit 8704ed9

Please sign in to comment.