twitter-archive / twitter-text-js

A JavaScript implementation of Twitter's text processing library
1.21k stars 166 forks source link

add support for balanced parens in query #120

Open markevaul opened 10 years ago

markevaul commented 10 years ago

add support for query containing and ending in balanced parens such as http://www.example.com?q=(1,2)

markevaul commented 10 years ago

I'd like to add some test cases to the conformance tests as well

http://www.example.com?q=(1,2) => http://www.example.com?q=(1,2) (http://www.example.com?q=(1,2)) => http://www.example.com?q=(1,2)

jakl commented 10 years ago

Oh sweet, thanks!

markevaul commented 10 years ago

The only issue i can think of with this fix is that I removed '(' and ')' from valid query characters, meaning that only balanced parens in query will be allowed. I'm not sure if this is an issue or not, but there are no unit tests that have parens in the query, other than the ones I added.

jakl commented 10 years ago

That sounds fair since we're already into balancing parens.

CLAassistant commented 4 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.