Skip to content

nbconvert.export() fails when markdown has invalid character #928

@Zackoon

Description

@Zackoon

Describe the bug
For Data 101, when running grader.export(...) (which exports a folder of .sql files as a zip file, and extracts the written responses into a PDF), it will fail, due to a parsing error in one of the .ipynb's markdown cells.

Note: grader = otter.Notebook(...)

To Reproduce
Steps to reproduce the behavior:

  1. Go to Data 101 Datahub (or presumably any notebook that uses grader.export(...) and extracts the written responses into a PDF). The project we noticed this error occurs in Project 3 (though probably happens in other projects too)
  2. Note that students use proj3.ipynb to write their written answers
  3. Under a question that gets its response extracted into the exported PDF, type \n", and it'll error.
  4. The error message will mention the line that had the `\n" is what caused it to error.
    Expected behavior
    The extracted PDF should be created and the output files as well, without any issue.

Versions
Python 3.11.12
Otter 6.1.0

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions