(text)
| 174 | } |
| 175 | |
| 176 | function extractMarkdownLinks(text) { |
| 177 | const links = []; |
| 178 | const pattern = /(?<!!)\[[^\]]+\]\(([^)\s]+(?:\s+"[^"]*")?)\)/g; |
| 179 | for (const match of text.matchAll(pattern)) { |
| 180 | links.push(match[1].replace(/\s+".*"$/, "")); |
| 181 | } |
| 182 | return links; |
| 183 | } |
| 184 | |
| 185 | function toLocalTarget(target) { |
| 186 | const cleanTarget = decodeURIComponent(target.replace(/^<|>$/g, "")); |