broaden anchor detection (not just anchor_N but anchor_anything)
This commit is contained in:
parent
8b0e1c0fa8
commit
4c42baf268
1 changed files with 8 additions and 12 deletions
|
@ -294,18 +294,14 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
|
|
||||||
function processAnchors(document: XMLDocument): SVGRectElement[] {
|
function processAnchors(document: XMLDocument): SVGRectElement[] {
|
||||||
let result = [];
|
const result: SVGRectElement[] = [];
|
||||||
let i = 1;
|
Array.from(document.getElementsByTagName("rect"))
|
||||||
while (true) {
|
.filter((el) => el.id.startsWith("anchor"))
|
||||||
let anchor = document.getElementById(`anchor_${i}`) as SVGRectElement | null;
|
.forEach((anchor) => {
|
||||||
if (anchor === null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
console.debug(`[SVG/ANCHORS] Found anchor #${anchor.id}.`);
|
console.debug(`[SVG/ANCHORS] Found anchor #${anchor.id}.`);
|
||||||
anchor.classList.add("internal");
|
anchor.classList.add("internal");
|
||||||
result.push(anchor);
|
result.push(anchor);
|
||||||
i++;
|
});
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue