(str: string)
| 38 | } |
| 39 | |
| 40 | export function stripMarkdownSync(str: string): string { |
| 41 | // A @ is added at the beginning and then removed before returning, as a work around for an open issue: |
| 42 | // https://github.com/remarkjs/strip-markdown/issues/19 |
| 43 | return remark() |
| 44 | .use(strip) |
| 45 | .processSync('@' + str) |
| 46 | .toString() |
| 47 | .trim() |
| 48 | .substr(1) |
| 49 | } |
| 50 | |
| 51 | export function addEllipsis(str: string, maxLength: number): string { |
| 52 | if (str.length > maxLength) { |
no outgoing calls
no test coverage detected