MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / toProse

Function toProse

apps/docs/scripts/check-rendered-markdown.mjs:41–46  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

39 * payloads like Expressive Code's `data-code="…"` copy-button cache, which
40 * mirrors the code sample and would otherwise read as a false positive. */
41function toProse(html) {
42 return html
43 .replace(/<pre[\s\S]*?<\/pre>/gi, " ")
44 .replace(/<code[\s\S]*?<\/code>/gi, " ")
45 .replace(/<[^>]+>/g, " ");
46}
47
48/* A GFM table delimiter row: a pipe adjacent to a run of 2+ dashes. Real
49 * prose effectively never contains this; a rendered table never does either

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected