From 6781da48bbfd69601c51b67364147b9c471cec2d Mon Sep 17 00:00:00 2001 From: Narutama Aurum Date: Tue, 9 Jun 2026 03:50:38 +0800 Subject: [PATCH] fix: remove redundant variable assignment in code-line.tsx - Remove unnecessary 'highlighted' variable that was just an alias for 'escaped' - Directly use 'escaped' in the highlight function logic This addresses a CodeRabbit nitpick from PR #447. --- modules/home/code-line.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/home/code-line.tsx b/modules/home/code-line.tsx index a523d2b..894193a 100644 --- a/modules/home/code-line.tsx +++ b/modules/home/code-line.tsx @@ -22,15 +22,14 @@ const escapeHtml = (unsafe: string) => { const highlight = (text: string) => { const escaped = escapeHtml(text); - const highlighted = escaped; // Comments (simple // for now) - if (highlighted.includes('//')) { - const parts = highlighted.split('//'); + if (escaped.includes('//')) { + const parts = escaped.split('//'); return <>{'//' + parts[1]}; } - return ; + return ; }; export const CodeLine = ({ line }: { line: string }) => {