From c63d0984f41adca7708df5f93b29243338e43bb2 Mon Sep 17 00:00:00 2001 From: Maciej Barelkowski Date: Mon, 4 Oct 2021 17:50:53 +0200 Subject: [PATCH] fix(path-map): disallow nested tokens --- lib/draw/PathMap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/draw/PathMap.js b/lib/draw/PathMap.js index f68475fe..a55e788a 100644 --- a/lib/draw/PathMap.js +++ b/lib/draw/PathMap.js @@ -444,8 +444,8 @@ export default function PathMap() { // helpers ////////////////////// -// copied from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js -var tokenRegex = /\{([^}]+)\}/g, +// copied and adjusted from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js +var tokenRegex = /\{([^{}]+)\}/g, objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches .xxxxx or ["xxxxx"] to run over object properties function replacer(all, key, obj) {