We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 748be60 commit 60633beCopy full SHA for 60633be
src/components/Pre.js
@@ -103,10 +103,10 @@ export default function Pre({
103
const content = code
104
.split('\n')
105
.map((line) => {
106
- if (line.startsWith('+ ')) {
107
- return `// diff-add\n${line.replace(/^\+ /, '')}`;
108
- } else if (line.startsWith('- ')) {
109
- return `// diff-remove\n${line.replace(/^- /, '')}`;
+ if (line.startsWith('+')) {
+ return `// diff-add\n${line.replace(/^\+\s?/, '')}`;
+ } else if (line.startsWith('-')) {
+ return `// diff-remove\n${line.replace(/^-\s?/, '')}`;
110
}
111
112
return line;
0 commit comments