Skip to content

Commit a2cd4b1

Browse files
committed
never enable markdown code runner *inside* for cells inside of a jupyter notebook
- it's too confusing
1 parent 07002cf commit a2cd4b1

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/packages/frontend/components/run-button/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,16 @@ export default function RunButton({
8585
setInfo,
8686
}: Props) {
8787
const mode = infoToMode(info);
88-
const noRun = NO_RUN.has(mode);
8988

9089
const {
90+
disableMarkdownCodebar,
9191
jupyterApiEnabled,
9292
project_id,
9393
path: filename,
9494
is_visible,
9595
/*hasOpenAI, */
9696
} = useFileContext();
97+
const noRun = NO_RUN.has(mode) || disableMarkdownCodebar;
9798
const path = project_id && filename ? path_split(filename).head : undefined;
9899
const [running, setRunning] = useState<boolean>(false);
99100
const outputMessagesRef = useRef<object[] | null>(null);
@@ -140,8 +141,9 @@ export default function RunButton({
140141
setOutput == null ||
141142
running ||
142143
!info.trim()
143-
)
144+
) {
144145
return;
146+
}
145147
const { output: messages, kernel: usedKernel } = getFromCache({
146148
input,
147149
history,

src/packages/frontend/jupyter/cell-input.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ React component that describes the input of a cell
99

1010
import { Map } from "immutable";
1111
import { useCallback, useEffect, useRef } from "react";
12-
1312
import { React, Rendered, redux } from "@cocalc/frontend/app-framework";
1413
import { HiddenXS } from "@cocalc/frontend/components/hidden-visible";
1514
import MarkdownInput from "@cocalc/frontend/editors/markdown-input/multimode";

src/packages/frontend/jupyter/cell-list.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,12 @@ export const CellList: React.FC<CellListProps> = (props: CellListProps) => {
726726

727727
return (
728728
<FileContext.Provider
729-
value={{ ...fileContext, noSanitize: !!trust, HeadingTagComponent }}
729+
value={{
730+
...fileContext,
731+
noSanitize: !!trust,
732+
HeadingTagComponent,
733+
disableMarkdownCodebar: true,
734+
}}
730735
>
731736
{body}
732737
</FileContext.Provider>

0 commit comments

Comments
 (0)