MCPcopy Index your code
hub / github.com/deepnote/deepnote / escapeHtmlAttribute

Function escapeHtmlAttribute

packages/blocks/src/blocks/image-blocks.ts:3–10  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

1import type { DeepnoteBlock, ImageBlock } from '../deepnote-file/deepnote-file-schema'
2
3function escapeHtmlAttribute(value: string): string {
4 return value
5 .replace(/&/g, '&')
6 .replace(/</g, '&lt;')
7 .replace(/>/g, '&gt;')
8 .replace(/"/g, '&quot;')
9 .replace(/'/g, '&#39;')
10}
11
12function sanitizeWidth(width: string): string {
13 // Extract only numeric characters

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected