voodoocode / pannengeraet-krank-knarrenbauer

🍳 Replaces Abhörgerät Kommt-Kampfhubschrauber by silly names
MIT License
67 stars 7 forks source link

Tweak regex to match name with missing hyphen #18

Closed catearcher closed 3 years ago

catearcher commented 3 years ago

This PR tweaks the full name regex to allow a single space in place of the hyphen between the two surnames of Krank-Knarrenbauer.

It's a common mistake to forget about proper hyphenation, so this change catches that.

As a side effect, this actually fixes the hyphenation on websites that get it wrong. I guess it could be discussed if this is a bug or a feature. In case we want to leave the incorrect hyphenation intact we'd have to add a capture group around [ -] and then add the captured character in line 172. I'd advise against that, though. I like it if punctuation gets fixed.

voodoocode commented 3 years ago

As a side effect, this actually fixes the hyphenation on websites that get it wrong.

I also like it. Thanks a lot!