Skip to content

Commit d1f4b17

Browse files
fix
1 parent 133ed48 commit d1f4b17

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/react/src/components/DiffContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const getStyleObjectFromString = memoFunc((str: string) => {
4141
return style;
4242
});
4343

44-
export const getTemplate = (line: SyntaxLine) => {
44+
export const getTemplate = (line: SyntaxLineWithTemplate) => {
4545
let template = "";
4646

4747
line?.nodeList?.forEach(({ node, wrapper }) => {
@@ -50,7 +50,7 @@ export const getTemplate = (line: SyntaxLine) => {
5050
)?.join(" ")}" style="${wrapper?.properties?.style || ""}">${escapeHtml(node.value)}</span>`;
5151
});
5252

53-
return template;
53+
line.template = template;
5454
};
5555

5656
const DiffString = ({

packages/vue/src/components/DiffContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { DiffNoNewLine } from "./DiffNoNewLine";
1010

1111
import type { DiffFile, DiffLine, SyntaxLine, SyntaxLineWithTemplate } from "@git-diff-view/core";
1212

13-
export const getTemplate = (line: SyntaxLine) => {
13+
export const getTemplate = (line: SyntaxLineWithTemplate) => {
1414
let template = "";
1515

1616
line?.nodeList?.forEach(({ node, wrapper }) => {
@@ -19,7 +19,7 @@ export const getTemplate = (line: SyntaxLine) => {
1919
)?.join(" ")}" style="${wrapper?.properties?.style || ""}">${escapeHtml(node.value)}</span>`;
2020
});
2121

22-
return template;
22+
line.template = template;
2323
};
2424

2525
const DiffString = ({

0 commit comments

Comments
 (0)