import{withPathPrefix as m,withoutPathPrefix as p}from"@redocly/theme/core/utils";import{isLocalLink as u}from"../../../../utils/path/is-local-link.js";import{getNodeAttribute as s}from"../../../../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as l}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{resolveLink as a}from"./resolve-link.js";async function H(r,t="href",n,c){const i=s(r,"attrs")||{},e=i[t];if(!e)return;const h=p(e);l(r,t,h),await a(r,t,n,c);const o=s(r,t);if(delete r.attributes[t],!o)return;let f=o;!o.startsWith("#")&&u(o)&&(f=m(o)),l(r,"attrs",{...i,[t]:f})}export{H as resolveHtmlHref};
