Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JN7 markdown cells mess #7002

Closed
liquidcarbon opened this issue Aug 7, 2023 · 9 comments
Closed

JN7 markdown cells mess #7002

liquidcarbon opened this issue Aug 7, 2023 · 9 comments

Comments

@liquidcarbon
Copy link

liquidcarbon commented Aug 7, 2023

Is anyone else experiencing issues with markdown cells where you paste a block of text and it does not show up correctly in the output? It tends to happen more with block quotes and triple quoted code blocks. When you go back to edit the code, your edits also don't appear in the right places. It's rather erratic and hard to reproduce with a specific example. This is happening for me in both Firefox and Edge. I'm under Windows and the notebook is hosted on a Linux server, but I'm pretty sure this was happening locally as well.

Please answer the following questions for yourself before submitting an issue

  • [ x ] I checked the documentation and found no answer
  • [ x ] I checked to make sure that this issue has not already been filed
  • [ x ] I'm reporting the issue to the correct repository

Example input:
image

Example output, after pressing Ctrl+Enter:
image

And it's actually messed up in the saved ipynb file, too:

  {
   "cell_type": "markdown",
   "id": "553ceae0-fb2c-4207-b52c-a5eca8f99ab8",
   "metadata": {},
   "source": [
    "> Is anyone else experiencing issues with markdown cells where you paste a block of text and it does not show up correctly in the output? It tends to happen more with block quotes and triple quoted code blocks. When you go back to edit the code, your edits also don't appear in the right places. It's rather erratic and hard to reproduce with a specific example. This is happening for me in both Firefox and Edge.\r\n",
    "\r\n",
    "Please answer the following questions for yourself before submitting an issue\r\n",
    "\r\n",
    "    [ x ] I checked the documentation and found no answer\r\n",
    "    [ x ] I checked to make sure that this issue has not already been filed\r\n",
    "    [ x ] I'm reporting the issue to the correct repos\n",
    "```itory\r\n",
    "\r\n",
    "If you have further questions after reading below, please visit the Jupyter Notebook discourse channel (https://discourse.jupyter.org/) and submit your questions there. There are many more people in the Jupyter community that engage on that c repository.\r\n",
    "\r\n",
    "We recommend that you check out JupyterLab (https://github.com/jupyterlab/jupyterlab), Jupyter's next generation Notebook interface.\r\n",
    "\r\n",
    "Here, we're looking for specific bugs in the Jupyter Notebook codebase. If you think you've identified such a bug, you can continue opening your issue here. We'd appreciate if you include as much detail as possible, such as links to the offending code, snapshots of the UI issue, code blocks with your c\n",
    "```onsole logs, etc."
   ]
  },
@liquidcarbon liquidcarbon added bug status:Needs Triage Applied to issues that need triage labels Aug 7, 2023
@RRosio RRosio removed the status:Needs Triage Applied to issues that need triage label Aug 8, 2023
@RRosio
Copy link
Collaborator

RRosio commented Aug 8, 2023

Thank you @liquidcarbon for opening this issue! Something like this, dealing with Windows line endings, has been previously reported in JupyterLab jupyterlab/jupyterlab#14752.

@jtpio
Copy link
Member

jtpio commented Aug 9, 2023

Since Notebook 7 is based on JupyterLab components, this will likely have to be fixed in JupyterLab first and then pulled in Notbeook 7.

@kuhlaid
Copy link

kuhlaid commented Sep 8, 2023

This is a problem with Windows, NOT Jupyter Lab. Whether it can be controlled within VsCode is another thing.

For example, take ANY code in VsCode with LF line endings (it can be Python code, a Jupyter notebook, etc) and copy several lines of the code then paste it into the online service https://www.soscisurvey.de/tools/view-chars.php and choose Show me the characters button, it will show you CRLF line endings even though your code within VsCode has LF line endings.

@liquidcarbon
Copy link
Author

@kuhlaid if CRLF problem is all this really is, it has been solved for a good decade in the old Jupyter notebook and older JupyterLab and every other tool crossplatform tool, but somehow it's a problem in the new JN

@OrianeN
Copy link

OrianeN commented Oct 2, 2023

I have the same issue - running Jupyter from a Docker container on a Linux VM, opening with Chrome on Windows:

Example input:
image

Output:
image

Even worse, when I opened the notebook again a few days later, I found that the input cell text was broken as well !

Copying the cell contents to https://www.soscisurvey.de/tools/view-chars.php I can see the line endings are CRLF.

I have Jupyter Notebook v7.0.3 installed.

I hope this will be solved soon.

@kiliansinger
Copy link

kiliansinger commented Feb 12, 2024

I can confirm this problem. It is reported in jupyterlab: jupyterlab/jupyterlab#14752

And indeed is related to \r\n line ending problem. It seems to be started all in summer 2023. Maybe a git bisect will reveal the revision where this happended. At first only the rendering is affected. And I most oftenly find the issue with tripple quotes for code also. And when reopening the file then the markdown source is even missing some input.

@kiliansinger
Copy link

I made a PR it should be fixed in the coming bug fix.

@krassowski
Copy link
Member

@jtpio I think this can be closed a fixed by jupyterlab/jupyterlab#15794 (I do not have rights to close issues here)

@jtpio
Copy link
Member

jtpio commented May 30, 2024

OK, thanks for checking!

@jtpio jtpio closed this as completed May 30, 2024
aditya0by0 added a commit to ChEB-AI/python-chebai that referenced this issue Aug 27, 2024
- jupyter/notebook#7002
- Fix using notebook formatter provided by pycharm professional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants