diff --git a/packages/react/src/components/DiffContent.tsx b/packages/react/src/components/DiffContent.tsx index 1aa1bf9..38c23e0 100644 --- a/packages/react/src/components/DiffContent.tsx +++ b/packages/react/src/components/DiffContent.tsx @@ -71,7 +71,14 @@ const DiffString = ({ operator === "add" ? `var(${addContentHighlightBGName})` : `var(${delContentHighlightBGName})`, }} > - {isLast ? `${_str2}${getSymbol(isNewLineSymbolChanged)}` : str2} + {isLast ? ( + <> + {_str2} + {getSymbol(isNewLineSymbolChanged)} + + ) : ( + str2 + )} {str3} @@ -164,7 +171,14 @@ const DiffSyntax = ({ borderBottomRightRadius: isEnd || isLast ? "0.2em" : undefined, }} > - {isLast ? `${_str2}${getSymbol(isNewLineSymbolChanged)}` : str2} + {isLast ? ( + <> + {_str2} + {getSymbol(isNewLineSymbolChanged)} + + ) : ( + str2 + )} {str3} diff --git a/packages/vue/src/components/DiffContent.tsx b/packages/vue/src/components/DiffContent.tsx index 3accd06..f43fa8f 100644 --- a/packages/vue/src/components/DiffContent.tsx +++ b/packages/vue/src/components/DiffContent.tsx @@ -41,7 +41,14 @@ const DiffString = ({ operator === "add" ? `var(${addContentHighlightBGName})` : `var(${delContentHighlightBGName})`, }} > - {isLast ? `${_str2}${getSymbol(isNewLineSymbolChanged)}` : str2} + {isLast ? ( + <> + {_str2} + {getSymbol(isNewLineSymbolChanged)} + + ) : ( + str2 + )} {str3} @@ -134,7 +141,14 @@ const DiffSyntax = ({ borderBottomRightRadius: isEnd || isLast ? "0.2em" : undefined, }} > - {isLast ? `${_str2}${getSymbol(isNewLineSymbolChanged)}` : str2} + {isLast ? ( + <> + {_str2} + {getSymbol(isNewLineSymbolChanged)} + + ) : ( + str2 + )} {str3}