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

all rendered notebook return malformed html #1058

Open
tonyfast opened this issue Mar 27, 2024 · 1 comment
Open

all rendered notebook return malformed html #1058

tonyfast opened this issue Mar 27, 2024 · 1 comment

Comments

@tonyfast
Copy link

Describe the bug
when nbviewer renders the notebook body it recieves a complete html document including a new head and body. this is invalid html if we check it on the w3c validator.

To Reproduce
Steps to reproduce the behavior:

  1. visit https://validator.w3.org/
  2. enter an nbviewer url like https://github.com/jupyterlab/jupyterlab-demo/blob/master/notebooks/Lorenz.ipynb
  3. Scroll down to Error Stray Doctype

Expected behavior
two options:

  1. the javascript assets for the notebook are loaded in the existing head and the notebook contents is rendered inside the body.
  2. iframe!

Screenshots
image

Additional context
these errors were discovered when trying to remediate the accessibility of nbviewer. most accessibility fixes can't be made until we have well formed html. the current malformed dom structure will have unknown effects across browsers, AT, and OS.

@tonyfast
Copy link
Author

tonyfast commented Apr 5, 2024

it would be really nice to have the w3c validator running as a pytest for several different projects including nbconvert and nbviewer. this is a feature in nbconvert-a11y that might be worth extracting https://github.com/deathbeds/nbconvert-a11y/blob/main/nbconvert_a11y/pytest_w3c.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant