(str: string)
| 23 | * Removes markdown and html from a string |
| 24 | */ |
| 25 | export function stripMarkdown(str: string): Promise<string> { |
| 26 | // A @ is added at the beginning and then removed before returning, as a work around for an open issue: |
| 27 | // https://github.com/remarkjs/strip-markdown/issues/19 |
| 28 | return new Promise((resolve, reject) => { |
| 29 | remark() |
| 30 | .use(strip) |
| 31 | .process('@' + str, (err, file) => { |
| 32 | if (err) { |
| 33 | return reject(err) |
| 34 | } |
| 35 | resolve(file.toString().trim().substr(1)) |
| 36 | }) |
| 37 | }) |
| 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: |
no outgoing calls
no test coverage detected