What does this change?
This improves how accented characters and numbers are handled in crosswords by:
What is the value of this and can you measure success?
Currently certain crosswords are uncompletable. This can be unfulfilling for anyone trying to solve them. Others have seen this too, for example, there's a few comments about it on a recent weekend crossword.
Does this affect other platforms?
Does this affect GLabs Paid Content Pages? Should it have support for Paid Content?
Does this change break ad-free?
Accessibility test checklist
I've worked on extracting the crossword component which has made it easier for me to work on these fixes independently of the rest of the frontend codebase. I've been able to run tests & linters for the isolated component and test it in browser to give me the confidence that this fixes the issue.
I've read that certain contributions require a signed CLA as I'm an external contributor. Please let me know if this is required since I'm happy to do this.
Sometimes crossword answers have numbers in them. Recently 2 down & 12 across in Weekend crossword No 410 are examples of this. The existing regular expression to validate input doesn't allow digits, causing nothing to happen when they are inputted. I considered removing this check and replacing it with somthing simpler- such as any single non-whitespace character but I'm not quite sure why it exists at the moment and it has recently been extended in this way to allow accented characters.  https://www.theguardian.com/crosswords/weekend/410
This regex is used to determine if the clue should be marked as answered and so greyed out in the clue list. Previously the check that it did was more restrictive than the check on input which meant an answer that contained accents would never cause a clue to be marked as answered. In the previous commit I also allowed answers to contain numbers which would have a similar problem without this change. I could have fixed this by making this regex the same as the input validation in crossword.js by duplicating it or sharing the code. However, I think a simpler thing to do is to make this less restrictive- if we are validating characters on input all we need to do here is check that a character has been inputted by making sure the value isn't the empty string. The code also works if the value is `null` or `undefined`.
Hey @zetter this is great.
We're really happy that you've also taken the time to extract the component into its own codebase. I guess we should probably consider whether it should have its own codebase and package instead of living in the frontend repo.
N.B. I pulled this branch and pushed it to frontend to build it on teamcity, but it needed rebasing against master. I'm not sure how that build got associated with this PR and the post rebase one didn't. I deployed the rebased branch on CODE and it's AOK 👌🏻
tldr: this builds and deploys okay