Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plusplus regex so ++ relates only to adjacent word #2

Open
ajacksified opened this issue Oct 28, 2013 · 1 comment
Open

Fix plusplus regex so ++ relates only to adjacent word #2

ajacksified opened this issue Oct 28, 2013 · 1 comment

Comments

@ajacksified
Copy link
Owner

(Moving github/hubot-scripts#1191 to here.)

@patcon said:

This doesn't seem right:

https://www.evernote.com/shard/s27/sh/a7136918-6846-44b2-a54c-72c058991b1e/8e297e8ea6f8945333e12db75313b28f

Likely culprit: https://github.com/github/hubot-scripts/blob/master/src/scripts/karma.coffee#L87
cc: @arvinsingla

EDIT: Just realized I'd mislabelled this as being an issue with karma.coffee, but it's plusplus.coffee
cc: @ajacksified

@ajacksified said:

the trouble is with names like "Herbert J. Hoover" - what's the adjacent word? I suppose we could try to allow a short list of punctuation (., spaces) but then how would you upvote "NOW! That's what I call music! 17"?

I've found through experimenting with trying to be more clever about "word" detection can, in may cases, just make it difficult to upvote weird words. Thoughts?

@patcon said:

Oh... maybe we could have an envvar for characters to ignore from matching, but default could be to allow spaces and whatever else you think should be in default? Like I think we only want single words (and our usernames are single words), but I'd rather not fork the script for that.

Here's our use-case so far: People are often saying things like "hahaha that's totally whatever! erin++", and it used to take it as "hahaha++", but I think now its the whole sentence, if that makes sense. I'd love a way to customize for single-word plusplus'ing by default, but allowing multi-word if quotes are used. I can maybe figure out the regex for that later. coffeescript regex blocks allow easy interpolation, so I think we can figure out how to do a character blacklist :)

@patcon
Copy link
Contributor

patcon commented Oct 30, 2013

ajacksified added a commit that referenced this issue Dec 31, 2014
Trivial : README : "thing-- for" : remove not give
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants