Khan/live-editor

Oh Noes renders HTML tags when ProcessingJS throws an error

Opened this issue · 0 comments

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.