brownplt / code.pyret.org

Website for serving Pyret to folks.
Other
24 stars 44 forks source link

Can HTML entities also be replaced? #508

Closed schanzer closed 4 months ago

schanzer commented 5 months ago

In text-handlers.js, it looks like there's a list of unicode characters that get auto replaced when pasted into CPO. I'm trying to paste text from an auto-generated workbook page that contains a lot of ​.

These show up as red dots in CPO:

image

Can we detect and replace HTML entities like this, or do they have to be unicode?

asolove commented 5 months ago

We can remove these. I think I know how, but can you send me some sample input (maybe as hexdump?) so I can test on it? (I don't think in the end this has anything to do with html entities, it's just checking for non-visible code points in the pasted string, and we can deal with that.)

schanzer commented 5 months ago

Pasting the text into my text editor revealed the characters:

image

The attached file includes the following, showing html entities:

fun f​(​x​): (​5613.67 ​* x​) + -83616.02 end

model-college-v-income-1.txt