- Revert prefer-named-capture-group due to apparently problematic Babel plugin

This commit is contained in:
Brett Zamir
2019-11-16 10:08:38 +08:00
parent cd0bdd9cce
commit 19f7962c4a
33 changed files with 315 additions and 2146 deletions

View File

@@ -65,11 +65,14 @@ export default {
function getLinked (elem, attr) {
const str = elem.getAttribute(attr);
if (!str) { return null; }
const m = str.match(/\(#(?<id>.+)\)/);
if (!m || !m.groups.id) {
const m = str.match(/\(#(.*)\)/);
// const m = str.match(/\(#(?<id>.+)\)/);
// if (!m || !m.groups.id) {
if (!m || m.length !== 2) {
return null;
}
return svgCanvas.getElem(m.groups.id);
return svgCanvas.getElem(m[1]);
// return svgCanvas.getElem(m.groups.id);
}
/**