Skip to content

Commit 341102f

Browse files
authored
Workaround issue with markdown lost on edit (#1016)
* Resolve traitlets type warnings, lint, remove `six` * Workaround issue with markdown lost on edit
1 parent 82bf833 commit 341102f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/jupyterlab-lsp/src/edits.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ export class EditApplicator {
189189
if (!editor) {
190190
throw Error('Editor is not accessible');
191191
}
192+
if (editor.host.closest('.jp-MarkdownCell')) {
193+
// Workaround for https://github.com/jupyter-lsp/jupyterlab-lsp/issues/1008
194+
// briefly, the rewrite for JupyterLab 4.0 added Markdown cell support, but they
195+
// are extracted without trace in the top-level document. Here we avoid editing
196+
// any markdown cell. Instead the clean solution would be to add an anchor marker
197+
// to the top-level document.
198+
return 0;
199+
}
192200
// TODO: should accessor present the model even if editor is not created yet?
193201
const model = editor.model;
194202

0 commit comments

Comments
 (0)