MCPcopy Index your code
hub / github.com/simstudioai/sim / htmlToPlainText

Function htmlToPlainText

apps/sim/connectors/utils.ts:20–30  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

18 * Strips HTML tags from content and decodes common HTML entities.
19 */
20export function htmlToPlainText(html: string): string {
21 let text = html.replace(/<[^>]*>/g, ' ')
22 text = text
23 .replace(/&nbsp;/g, ' ')
24 .replace(/&lt;/g, '<')
25 .replace(/&gt;/g, '>')
26 .replace(/&quot;/g, '"')
27 .replace(/&#39;/g, "'")
28 .replace(/&amp;/g, '&')
29 return text.replace(/\s+/g, ' ').trim()
30}
31
32/**
33 * Computes a SHA-256 hash of the given content string.

Callers 15

itemToPlainTextFunction · 0.90
workItemToDocumentFunction · 0.90
confluence.tsFile · 0.90
extractBodyFunction · 0.90
fetchFileContentFunction · 0.90
postToDocumentFunction · 0.90
downloadFileContentFunction · 0.90
buildContentFunction · 0.90
kbArticleToDocumentFunction · 0.90
incidentToDocumentFunction · 0.90
formatMessagesFunction · 0.90
fetchFileContentFunction · 0.90

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected