diff --git a/index.html b/index.html
index c71a7708..5465e6c4 100644
--- a/index.html
+++ b/index.html
@@ -8064,7 +8064,7 @@
-
+
diff --git a/modules/ui/tools.js b/modules/ui/tools.js
index 5d9d0d40..4d62305c 100644
--- a/modules/ui/tools.js
+++ b/modules/ui/tools.js
@@ -247,13 +247,16 @@ function recreateStates() {
capitalsTree.add([x, y]);
// update label id reference
- labels
- .select("#states")
- .select(`#stateLabel${state.i}`)
- .attr("id", `stateLabel${newId}`)
- .select("textPath")
- .attr("xlink:href", `#textPath_stateLabel${newId}`);
- defs.select("#textPaths").select(`#textPath_stateLabel${state.i}`).attr("id", `textPath_stateLabel${newId}`);
+ byId(`textPath_stateLabel${state.i}`)?.setAttribute("id", `textPath_stateLabel${newId}`);
+ const $label = byId(`stateLabel${state.i}`);
+ if ($label) {
+ $label.setAttribute("id", `stateLabel${newId}`);
+ const $textPath = $label.querySelector("textPath");
+ if ($textPath) {
+ $textPath.removeAttribute("href");
+ $textPath.setAttribute("href", `#textPath_stateLabel${newId}`);
+ }
+ }
// update emblem id reference
byId(`stateCOA${state.i}`)?.setAttribute("id", `stateCOA${newId}`);
diff --git a/versioning.js b/versioning.js
index bdaaca35..2bcedad9 100644
--- a/versioning.js
+++ b/versioning.js
@@ -1,7 +1,7 @@
"use strict";
// version and caching control
-const version = "1.96.02"; // generator version, update each time
+const version = "1.96.03"; // generator version, update each time
{
document.title += " v" + version;