(node)
| 245 | }).map; |
| 246 | |
| 247 | function findLink(node) { |
| 248 | if (node.type === 'link') { |
| 249 | return node; |
| 250 | } |
| 251 | |
| 252 | if (node.children) { |
| 253 | for (let child of node.children) { |
| 254 | let link = findLink(child); |
| 255 | if (link) { |
| 256 | return link; |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * Go from complex structure that the mdx plugin renders from to a simpler one |