Skip to content

Commit

Permalink
Update Bot.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
daoauth committed Dec 12, 2024
1 parent 5eefdcd commit c52cb4d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/webview/panel/src/components/Bot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export const Bot = ({ data }: { data: string }) => {
code: ({ text, lang }: { text: string; lang?: string }) => {
const language = lang && hljs.getLanguage(lang) ? lang : 'plaintext';
const highlighted = hljs.highlight(text, { language }).value;
return `<pre style="overflow-x: auto;"><code class="hljs ${language}">${highlighted}</code></pre>`;
return `<pre style="overflow-x: auto; font-family: monospace;"><code class="hljs ${language}">${highlighted}</code></pre>`;
},
};
marked.use({ renderer });
const renderedHtml = marked.parse(data, { async: false });
const renderedHtml = marked.parse(data, { async: false, gfm: true });
setHtml(() => renderedHtml);
}, [data]);

Expand All @@ -25,8 +25,6 @@ export const Bot = ({ data }: { data: string }) => {
width: '80%',
textAlign: 'left',
marginBottom: '1rem',
fontFamily: 'monospace',
whiteSpace: 'pre-wrap',
}}
dangerouslySetInnerHTML={{ __html: html }}
/>
Expand Down

0 comments on commit c52cb4d

Please sign in to comment.