Skip to content

Commit

Permalink
Workaround issue with markdown lost on edit (#1016)
Browse files Browse the repository at this point in the history
* Resolve traitlets type warnings, lint, remove `six`

* Workaround issue with markdown lost on edit
  • Loading branch information
krassowski authored Nov 25, 2023
1 parent 82bf833 commit 341102f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/jupyterlab-lsp/src/edits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ export class EditApplicator {
if (!editor) {
throw Error('Editor is not accessible');
}
if (editor.host.closest('.jp-MarkdownCell')) {
// Workaround for https://github.com/jupyter-lsp/jupyterlab-lsp/issues/1008
// briefly, the rewrite for JupyterLab 4.0 added Markdown cell support, but they
// are extracted without trace in the top-level document. Here we avoid editing
// any markdown cell. Instead the clean solution would be to add an anchor marker
// to the top-level document.
return 0;
}
// TODO: should accessor present the model even if editor is not created yet?
const model = editor.model;

Expand Down

0 comments on commit 341102f

Please sign in to comment.