kellnerd / musicbrainz-scripts

Bookmarklets and Userscripts for MusicBrainz.org
MIT License
31 stars 2 forks source link

Add special case for 'n' #6

Closed ROpdebee closed 3 years ago

ROpdebee commented 3 years ago

I've ran into this little bugger a couple of times and it's incorrectly converted into ā€˜nā€™. I've added a special case before the usual processing of balanced 's since that's (probably) the easiest way to fix it.

I was a bit reluctant though, since the potential for special casing is near-infinite, but I think this case is common enough to warrant it.

Tested on https://test.musicbrainz.org/release/71d7aa3d-17d5-47e2-9a73-be4ac4e6a011 and everything else still works as it should.

kellnerd commented 3 years ago

Thank you for the suggestion, since there already is a substitution for single primes (which are even less common than 'n') it probably won't hurt to add this. I love your idea of an actual punctuation test release. Now I feel slightly ashamed that I have done most of my testing on the production server by temporarily altering real releases without submitting the changes (although I have used the test server for other things before šŸ™ˆ).

ROpdebee commented 3 years ago

I think, given that these files are so well-modularised, it shouldn't be too difficult to unit test these without a release. I'm not much a JS guy though, so I can't recommend any testing frameworks. You could maybe even do some CI through GitHub Actions or Travis. Even automatically building the userscripts and bookmarklets on commits through GitHub Actions isn't out of the question.