(summary: string)
| 70 | * is multi-line, long, or contains markdown block syntax. |
| 71 | */ |
| 72 | export function summaryNeedsBlockLayout(summary: string): boolean { |
| 73 | const contentLines = summary.split('\n').filter((l) => l.trim()); |
| 74 | if (contentLines.length > 1) return true; |
| 75 | if ((contentLines[0]?.length ?? 0) > INLINE_SUMMARY_MAX_LENGTH) return true; |
| 76 | return MARKDOWN_BLOCK_RE.test(summary); |
| 77 | } |
| 78 | |
| 79 | /** Strip leading/trailing blank lines while preserving internal structure (e.g. paragraph breaks) */ |
| 80 | export function trimBlankEdges(lines: string[]): string[] { |
no outgoing calls
no test coverage detected
searching dependent graphs…