MCPcopy
hub / github.com/npmx-dev/npmx.dev / escapeHtml

Function escapeHtml

test/nuxt/composables/use-markdown.spec.ts:4–11  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

2
3// Utility to use more human-readable strings in tests
4function escapeHtml(text: string): string {
5 return text
6 .replace(/&/g, '&')
7 .replace(/</g, '&lt;')
8 .replace(/>/g, '&gt;')
9 .replace(/"/g, '&quot;')
10 .replace(/'/g, '&#039;')
11}
12
13describe('useMarkdown', () => {
14 describe('plain text', () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected