(markdown)
| 21 | } |
| 22 | |
| 23 | function findRelativeLinks(markdown) { |
| 24 | return [...markdown.matchAll(/\[[^\]]+\]\(([^)]+)\)/g)] |
| 25 | .map((match) => match[1]) |
| 26 | .filter( |
| 27 | (target) => |
| 28 | !target.startsWith("http://") && |
| 29 | !target.startsWith("https://") && |
| 30 | !target.startsWith("app://") && |
| 31 | !target.startsWith("plugin://") && |
| 32 | !target.startsWith("rules://") && |
| 33 | !target.startsWith("mailto:") && |
| 34 | !target.startsWith("#"), |
| 35 | ); |
| 36 | } |
| 37 | |
| 38 | function isHyphenCase(value) { |
| 39 | return /^[a-z0-9-]+$/.test(value) && !value.startsWith("-") && !value.endsWith("-") && !value.includes("--"); |
no test coverage detected