Khan / Khan/live-editor

Oh Noes renders HTML tags when ProcessingJS throws an error

Open
#735 0 comments 0 reactions 0 assignees View on GitHub
pjs
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

Try a program with just:

bezierVertex(100, 10, 20, 20, 20, 20);

You'll then see:

Oh noes!
vertex() must be used at least once before calling bezierVertex()

ProcessingJS throws() the text, and then we wrap it in the span but display it as text:

if (typeof error === "string") {
newError.text = this.clean(this.prettify(error));
}

I wonder if we actually need to call prettify() in that situation- perhaps not. I'm not sure what other situations trigger that code path.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the bezierVertex() example, then trace the string-error branch containing clean() and prettify(). Check how the resulting error text is rendered and verify that the displayed message shows the intended text without literal HTML tags.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.