speedtyper.dev icon indicating copy to clipboard operation
speedtyper.dev copied to clipboard

Don't let non-latin characters in

Open wetfloo opened this issue 1 year ago • 4 comments

Otherwise you get this image

wetfloo avatar May 22 '23 13:05 wetfloo

+1, yesterday I got an emoji of a snowman in my snippet :D

ghost avatar Jul 12 '23 11:07 ghost

same problem, twice seen this file with heart image

dovvakkin avatar Jul 23 '23 19:07 dovvakkin

I'd be open to a PR on this. There are a couple of different options on approaches, but I'd consider something like this:

  • Add a function which checks if a string includes invalid characters. Unit test on several code examples to ensure it does not exclude valid snippets and correctly excludes invalid challenges.
  • Use function to filter out invalid nodes in the data seeding pipeline
  • Write a command backfilling current challenges and deletes it if it includes invalid characters

codicocodes avatar Sep 13 '23 17:09 codicocodes

Here are some example of commands, including backfills: https://github.com/codicocodes/speedtyper.dev/tree/main/packages/back-nest/src/challenges/commands

codicocodes avatar Sep 13 '23 22:09 codicocodes