Skip to content

Commit

Permalink
symbol element
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Dec 23, 2024
1 parent e1e87fd commit 8d7b0f8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
18 changes: 16 additions & 2 deletions packages/react/src/components/DiffContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ const DiffString = ({
operator === "add" ? `var(${addContentHighlightBGName})` : `var(${delContentHighlightBGName})`,
}}
>
{isLast ? `${_str2}${getSymbol(isNewLineSymbolChanged)}` : str2}
{isLast ? (
<>
{_str2}
<span data-newline-symbol>{getSymbol(isNewLineSymbolChanged)}</span>
</>
) : (
str2
)}
</span>
{str3}
</span>
Expand Down Expand Up @@ -164,7 +171,14 @@ const DiffSyntax = ({
borderBottomRightRadius: isEnd || isLast ? "0.2em" : undefined,
}}
>
{isLast ? `${_str2}${getSymbol(isNewLineSymbolChanged)}` : str2}
{isLast ? (
<>
{_str2}
<span data-newline-symbol>{getSymbol(isNewLineSymbolChanged)}</span>
</>
) : (
str2
)}
</span>
{str3}
</span>
Expand Down
18 changes: 16 additions & 2 deletions packages/vue/src/components/DiffContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ const DiffString = ({
operator === "add" ? `var(${addContentHighlightBGName})` : `var(${delContentHighlightBGName})`,
}}
>
{isLast ? `${_str2}${getSymbol(isNewLineSymbolChanged)}` : str2}
{isLast ? (
<>
{_str2}
<span data-newline-symbol>{getSymbol(isNewLineSymbolChanged)}</span>
</>
) : (
str2
)}
</span>
{str3}
</span>
Expand Down Expand Up @@ -134,7 +141,14 @@ const DiffSyntax = ({
borderBottomRightRadius: isEnd || isLast ? "0.2em" : undefined,
}}
>
{isLast ? `${_str2}${getSymbol(isNewLineSymbolChanged)}` : str2}
{isLast ? (
<>
{_str2}
<span data-newline-symbol>{getSymbol(isNewLineSymbolChanged)}</span>
</>
) : (
str2
)}
</span>
{str3}
</span>
Expand Down

0 comments on commit 8d7b0f8

Please sign in to comment.