(text)
| 14 | */ |
| 15 | function transformCustomLinks() { |
| 16 | function getLinkNode(text) { |
| 17 | const linkMatch = text.match(/<a href="(\/\S+)">([^\s<]+)<\/a>/); |
| 18 | |
| 19 | if (!linkMatch) { |
| 20 | return null; |
| 21 | } |
| 22 | |
| 23 | const [, linkHref, linkText] = linkMatch; |
| 24 | return { |
| 25 | type: "element", |
| 26 | tagName: "a", |
| 27 | properties: { href: linkHref }, |
| 28 | children: [{ type: "text", value: linkText }], |
| 29 | }; |
| 30 | } |
| 31 | |
| 32 | return (tree) => { |
| 33 | visit(tree, "element", (code) => { |
no outgoing calls
no test coverage detected