Skip to content

Commit 8acaa1f

Browse files
authored
Fix diff rendering
1 parent 61046a8 commit 8acaa1f

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/report.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,32 @@ function formatDiff(diff: string) {
7878
const linesCount = diff.split("\n").length;
7979
const code = codeBlock(diff, "diff");
8080
return linesCount > LONG_DIFF_THRESHOLD_IN_LINES
81+
// Note: do not indent the code block, otherwise the diff render incorrectly in comments.
82+
/*
83+
``````md
84+
```diff
85+
- this is not remove
86+
```
87+
``````
88+
89+
and
90+
91+
92+
``````md
93+
```diff
94+
- this is not remove
95+
```
96+
``````
97+
98+
are different
99+
*/
100+
81101
? outdent`
82102
<details>
83103
<summary>Diff (${linesCount} lines)</summary>
84104
85-
${code}
105+
106+
${code}
86107
87108
</details>
88109
`

0 commit comments

Comments
 (0)