MCPcopy Create free account
hub / github.com/danvk/webdiff / makeCodeTd

Function makeCodeTd

ts/codediff/DiffRow.tsx:27–36  ·  view source on GitHub ↗
(type: string, text: string | undefined, html: string | undefined)

Source from the content-addressed store, hash-verified

25}
26
27const makeCodeTd = (type: string, text: string | undefined, html: string | undefined) => {
28 if (text === undefined) {
29 return {text: '', html: '', className: 'empty code'};
30 }
31 html ??= escapeHtml(text);
32 text = text.replaceAll('\t', '\u00a0\u00a0\u00a0\u00a0');
33 html = html.replaceAll('\t', '\u00a0\u00a0\u00a0\u00a0');
34 const className = 'code ' + type;
35 return {className, html, text};
36};
37
38export function DiffRow(props: DiffRowProps) {
39 const {beforeLineNum, afterLineNum, type, isSelected} = props;

Callers 1

DiffRowFunction · 0.85

Calls 1

escapeHtmlFunction · 0.85

Tested by

no test coverage detected