UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 537 B
import{t as fromMarkdown}from"./lib-vtjvZm5r.mjs"; //!packages/markdown-core/src/link-spans.ts function findMarkdownLinkSourceSpans(e){const t=[];const n=[fromMarkdown(e)];while(n.length>0){const e=n.pop();if(!e)continue;if([`link`,`image`,`linkReference`,`imageReference`,`definition`].includes(e.type)){const n=e.position?.start?.offset;const r=e.position?.end?.offset;if(n!==void 0&&r!==void 0)t.push([n,r]);continue}for(const t of e.children??[])n.push(t)}return t.toSorted((e,t)=>e[0]-t[0])}export{findMarkdownLinkSourceSpans as t};