Fix linting

This commit is contained in:
yangdx
2025-04-22 09:05:23 +08:00
parent fd997f239b
commit be032db1f8

View File

@@ -25,7 +25,7 @@ export type MessageWithError = Message & {
export const ChatMessage = ({ message }: { message: MessageWithError }) => { export const ChatMessage = ({ message }: { message: MessageWithError }) => {
const { t } = useTranslation() const { t } = useTranslation()
// Remove extra spaces around bold text // Remove extra spaces around bold text
message.content = message.content.replace(/\*\ {3}/g, '').replace(/\ {4}\*\*/g, '**') message.content = message.content.replace(/\* {3}/g, '').replace(/ {4}\*\*/g, '**')
const handleCopyMarkdown = useCallback(async () => { const handleCopyMarkdown = useCallback(async () => {
if (message.content) { if (message.content) {
@@ -147,7 +147,7 @@ const CodeHighlight = ({ className, children, node, ...props }: CodeHighlightPro
if (!looksPotentiallyComplete) { if (!looksPotentiallyComplete) {
console.log("Mermaid content might be incomplete, skipping render attempt:", rawContent); console.log('Mermaid content might be incomplete, skipping render attempt:', rawContent);
// Keep loading indicator or show a message // Keep loading indicator or show a message
// container.innerHTML = '<p class="text-sm text-muted-foreground">Waiting for complete diagram...</p>'; // container.innerHTML = '<p class="text-sm text-muted-foreground">Waiting for complete diagram...</p>';
return; // Don't attempt to render potentially incomplete content return; // Don't attempt to render potentially incomplete content
@@ -183,11 +183,11 @@ const CodeHighlight = ({ className, children, node, ...props }: CodeHighlightPro
} catch (bindError) { } catch (bindError) {
console.error('Mermaid bindFunctions error:', bindError); console.error('Mermaid bindFunctions error:', bindError);
// Optionally display a message in the container // Optionally display a message in the container
container.innerHTML += `<p class="text-orange-500 text-xs">Diagram interactions might be limited.</p>`; container.innerHTML += '<p class="text-orange-500 text-xs">Diagram interactions might be limited.</p>';
} }
} }
} else { } else {
console.log("Mermaid container changed before rendering completed."); console.log('Mermaid container changed before rendering completed.');
} }
}) })
.catch(error => { .catch(error => {