fix: Remove trailing newline in codeblocks

This commit is contained in:
shniubobo 2025-02-14 01:30:12 +00:00 committed by 亢奋猫
parent 76c0ad9985
commit f5cd6ecb50

View File

@ -60,6 +60,7 @@ export const SyntaxHighlighterProvider: React.FC<PropsWithChildren> = ({ childre
const mappedLanguage = languageMap[language] || language
code = code.trimEnd()
const escapedCode = code?.replace(/[<>]/g, (char) => ({ '<': '&lt;', '>': '&gt;' })[char]!)
try {