Nov25 fixes (#1072)

* update deps
* fixes #963 and #1061
* fix the issue #974
* update test
This commit is contained in:
JFH
2025-11-27 14:10:49 -03:00
committed by GitHub
parent 16a0e0d945
commit babd3490c9
6 changed files with 60 additions and 9 deletions

View File

@@ -1131,7 +1131,11 @@ export let getRotationAngle = (elem, toRad) => {
* @returns {Element} Reference element
*/
export const getRefElem = attrVal => {
return getElement(getUrlFromAttr(attrVal).substr(1))
if (!attrVal) return null
const url = getUrlFromAttr(attrVal)
if (!url) return null
const id = url[0] === '#' ? url.substr(1) : url
return getElement(id)
}
/**
* Get the reference element associated with the given attribute value.