const cachedDocument = new WeakMap();
function absoluteToDocOld(doc, attributeValue) {
if (!attributeValue || attributeValue.trim() === '') {
return attributeValue;
}
const a = doc.createElement('a');
a.href = attributeValue;
return a.href;
}
function absoluteToDocNew(doc, attributeValue) {
if (!attributeValue || attributeValue.trim() === '') {
return attributeValue;
}
let a = cachedDocument.get(doc);
if (!a) {
a = doc.createElement('a');
cachedDocument.set(doc, a);
}
a.href = './clear-current';
a.href = '';
a.href = attributeValue;
return a.href;
}