Skip to content

Cell output should escape text #69

@kcarnold

Description

@kcarnold

I noticed that trying to print(type(10)) doesn't show anything.

This is probably because stdout isn't getting escaped:

outputDiv.innerHTML = `<pre><code>${result.stdout}</code></pre>`;

The solution could look like:

      const outputDiv = document.createElement("div");
      outputDiv.className = "exercise-cell-output cell-output cell-output-pyodide cell-output-stdout";
      outputDiv.innerHTML = `<pre><code></code></pre>`;
      outputDiv.querySelector('code').textContent = result.stdout;
      container.appendChild(outputDiv);

The same should apply to stderr.

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