-
Notifications
You must be signed in to change notification settings - Fork 18
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
Cannot clean notebooks encountering “NotJSONError” with plotly js code inside #273
Comments
I'm not able to reproduce this using the same versions of nb-clean and nbformat, either using the Git filter or invoking nb-clean manually: $ nb-clean check plotly-example-2.ipynb
plotly-example-2.ipynb cell 0: metadata
plotly-example-2.ipynb cell 0: execution count
plotly-example-2.ipynb cell 0: outputs
plotly-example-2.ipynb metadata: language_info.version However, I'm on Linux whereas you're on Windows and there's a warning from Git that LF line endings will be replaced with CRLF line endings on checkout in your output. To see if the line ending conversion is involved, do you have the same error if you run nb-clean outside the Git filter ( |
I can pass the But when I use My CRLF setting in the git global config file
Should I alter the autocrlf setting to something else? |
According to this PR in another project, Jupyter notebooks are always created with LF line endings on Windows. That suggests adding the following to the
|
I'll assume configuring |
@srstevenson Thanks for this awesome repo. I am having some trouble cleaning notebooks with html/js inside. Below is the detailed error. Please kindly check it out :)
System :
Windows Server 2022 Datacenter 21H2 20348.2402
Core Packages :
jupyterlab >= 4.0.10
nbformat 5.9.2
nb-clean 3.2.0
plotly 5.18.0
Core Commands :
It works well on notebooks without plotly.
But getting error from this notebook with plotly's html js snippets in it. plotly-example-2.zip
Error :
I checked the json format. It happens on line 29 which is the beginning of a chunk of js snippet having confusing "" in it.
Can not reproduce using nbformat directly in python:
When I use nbformat to load, such error will not happen. It seems fine to get the whole html content in
notebook['cells'][0]['outputs'][0]['data']['text/html']
.The text was updated successfully, but these errors were encountered: