import{getPathPrefix as s,withPathPrefix as n}from"@redocly/theme/core/utils";import{isLocalLink as m}from"../../../../utils/path/is-local-link.js";import{getNodeAttribute as a}from"../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as p}from"../markdoc/helpers/set-node-attribute-value.js";import{resolveLink as h}from"./resolve-link.js";async function x(r,i,e,f){await h(r,i,e,f);const o=s();if(!o)return;const t=a(r,i);!t||t==="#"||!m(t)||t.startsWith(o)||p(r,i,t.startsWith("#")?t:n(t))}export{x as resolveNativeMdLink};
