( markdown: string | undefined, )
| 35 | }; |
| 36 | |
| 37 | const splitLeadingImage = ( |
| 38 | markdown: string | undefined, |
| 39 | ): {thumbnail?: Thumbnail; markdown: string} => { |
| 40 | const source = markdown ?? ''; |
| 41 | const trimmed = source.replace(/^\s+/, ''); |
| 42 | const [firstLine = ''] = trimmed.split('\n'); |
| 43 | const thumbnail = parseLeadingImage(firstLine.trim()); |
| 44 | return thumbnail == null |
| 45 | ? {markdown: source} |
| 46 | : { |
| 47 | thumbnail, |
| 48 | markdown: removeLeadingWhitespace(trimmed.slice(firstLine.length)), |
| 49 | }; |
| 50 | }; |
| 51 | |
| 52 | const getCommentText = ( |
| 53 | parts: {text: string}[] | undefined, |
no test coverage detected
searching dependent graphs…