You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JupyterLab 4 added support for Markdown documents by using extractors mechanisms; it seems that markdown cells are erroneously included as empty cells in the resulting Python document.
It seems that the logic in TextForeignCodeExtractor and in the extractForeignCode() or appendCodeBlock() need to be modified so that when an entire cell gets extracted no cell would be added (rather than adding an empty code cell, padded by two empty lines on each side).
For example if lines is just one empty line we could skip adding this.blankLinesBetweenCells. This need to be conditional on foreignDocumentsMap being non-empty so that it does not lead to false negatives (e.g. undetected empty code cells),
Context
JupyterLab version: 4.1.2
The text was updated successfully, but these errors were encountered:
Description
JupyterLab 4 added support for Markdown documents by using extractors mechanisms; it seems that markdown cells are erroneously included as empty cells in the resulting Python document.
It seems that the logic in
TextForeignCodeExtractor
and in theextractForeignCode()
orappendCodeBlock()
need to be modified so that when an entire cell gets extracted no cell would be added (rather than adding an empty code cell, padded by two empty lines on each side).Reproduce
See jupyterlab-lsp issues:
Expected behavior
When an entire cell is extracted do not add new lines before and after it.
This could be solved by special casing the logic in:
jupyterlab/packages/lsp/src/virtual/document.ts
Lines 614 to 673 in 2d68127
For example if
lines
is just one empty line we could skip addingthis.blankLinesBetweenCells
. This need to be conditional onforeignDocumentsMap
being non-empty so that it does not lead to false negatives (e.g. undetected empty code cells),Context
The text was updated successfully, but these errors were encountered: