(node)
| 76 | ].filter((markdown): markdown is string => markdown != null); |
| 77 | |
| 78 | export const extractThumbnailMarkdown: NodeTransform = (node) => { |
| 79 | if (node.reflection != null) { |
| 80 | node.data[THUMBNAIL] = getReflectionMarkdown(node.reflection) |
| 81 | .map((markdown) => findFirstImage(markdown)) |
| 82 | .find((thumbnail) => thumbnail != null); |
| 83 | return; |
| 84 | } |
| 85 | const summaryParts = splitLeadingImage(node.summary); |
| 86 | const bodyParts = splitLeadingImage(node.body); |
| 87 | node.data[THUMBNAIL] = summaryParts.thumbnail ?? bodyParts.thumbnail; |
| 88 | node.summary = summaryParts.markdown; |
| 89 | node.body = |
| 90 | summaryParts.thumbnail == null ? bodyParts.markdown : (node.body ?? ''); |
| 91 | }; |
| 92 | |
| 93 | export const getThumbnailMarkdown = ( |
| 94 | node: Node, |
nothing calls this directly
no test coverage detected
searching dependent graphs…