Skip to content

all rendered notebook return malformed html #1058

@tonyfast

Description

@tonyfast

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions