Skip to content

Commit

Permalink
use css to emulate code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-i committed Jan 9, 2024
1 parent 017788d commit 4325658
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/jupyter-ai/src/components/rendermime-markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export function RendermimeMarkdown(
if (!ref.current) {
return;
}

ref.current.innerHTML = '';
ref.current.className = 'custom-markdown'; // Apply the custom class

const mimeType = 'text/markdown';
const model = rmRegistry.createModel({
Expand Down
1 change: 1 addition & 0 deletions packages/jupyter-ai/style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
@import './expandable-text-field.css';
@import './react-markdown.css';
@import './chat-settings.css';
@import './rendermime-markdown.css'
6 changes: 6 additions & 0 deletions packages/jupyter-ai/style/rendermime-markdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.custom-markdown pre,
.custom-markdown pre > code {
background-color: var(--jp-cell-editor-background);
overflow-x: auto;
white-space: pre;
}

0 comments on commit 4325658

Please sign in to comment.