Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

firstLineTitle.ts

6 lines243 Bytes

1// Thread and scheduled-task lists render titles on one line.
2export const firstLineTitle = (title: string | undefined): string | undefined =>
3 title
4 ?.split(/[\r\n\u2028\u2029]/)
5 .find((line) => line.trim().length > 0)
6 ?.trim();