(html: string)
| 13 | // flow through. |
| 14 | const BODY_RE = /<body[^>]*>([\s\S]*?)<\/body>/i; |
| 15 | export const extractBody = (html: string): string => { |
| 16 | const m = BODY_RE.exec(html); |
| 17 | if (!m) return html; |
| 18 | return m[1].replace(/^[\s ]+/, '').replace(/[\s ]+$/, ''); |
| 19 | }; |
| 20 | |
| 21 | // Drop `<br>` immediately following a closing block tag. Etherpad's |
| 22 | // HTML export writes one `<p>...</p>` per pad line (or `<h1>...</h1>`, |
no outgoing calls
no test coverage detected