MCPcopy Create free account
hub / github.com/ether/etherpad / extractBody

Function extractBody

src/node/utils/ExportSanitizeHtml.ts:15–19  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

13// flow through.
14const BODY_RE = /<body[^>]*>([\s\S]*?)<\/body>/i;
15export 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>`,

Callers 2

export.tsFile · 0.85
ExportHandler.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected