fix: update language display logic in Shiki code highlighter

- Modified the language display condition to show an empty div for plaintext instead of rendering the language name and icon.
- This change improves the clarity of the code highlighter by avoiding unnecessary elements for plaintext.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-05-14 00:46:42 +08:00
parent 42150751f2
commit 20049b0150
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 4 additions and 2 deletions

View File

@ -193,7 +193,9 @@ const ShikiCode: FC<
)}
>
<div className="flex items-center justify-between border-b p-2">
{language !== "plaintext" && (
{language === "plaintext" ? (
<div />
) : (
<span className="center flex gap-1 text-xs uppercase opacity-80 dark:text-white">
<span className="center [&_svg]:size-4">{getLanguageIcon(language)}</span>
<span>{language}</span>

View File

@ -99,7 +99,7 @@ export const EntryContent: Component<EntryContentProps> = ({
EventBus.subscribe(COMMAND_ID.timeline.switchToNext, scrollAndFocus),
EventBus.subscribe(COMMAND_ID.timeline.switchToPrevious, scrollAndFocus),
)
}, [])
}, [entryId])
const safeUrl = useFeedSafeUrl(entryId)