plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Regex for hashtags does not detect :

Open saurabh-sikchi opened this issue 9 years ago • 5 comments

Hi,

The current regex for hashtags is /(\s)\#([a-zA-Z0-9_-]+)/ which fails on tags such as question:spectrometer (like here).

If the core contributors think this should be changed, I want to submit a fix for this.

Thanks.

saurabh-sikchi avatar Mar 12 '17 10:03 saurabh-sikchi

Yes please! Great catch. Would it be possible to write a test for this as well?

On Mar 12, 2017 6:24 AM, "Saurabh Sikchi" [email protected] wrote:

Hi,

The current regex for hashtags is /(\s)#([a-zA-Z0-9_-]+)/ which fails on tags such as question:spectrometer (like here https://github.com/publiclab/plots2/blob/master/test/fixtures/tags.yml#L23 ).

If the core contributors think this should be changed, I want to submit a fix for this.

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1331, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ9o2zTHPonf1WS4dwZP_2EINCD6nks5rk8fWgaJpZM4Maf9q .

jywarren avatar Mar 13 '17 04:03 jywarren

I am on it.

saurabh-sikchi avatar Mar 13 '17 04:03 saurabh-sikchi

@jywarren Where should the tests for this go?

saurabh-sikchi avatar Mar 13 '17 04:03 saurabh-sikchi

I think we have a new test suite for constants -- and unit tests are faster to run anyways: https://github.com/publiclab/plots2/blob/master/test/unit/constants_test.rb

you can run just unit tests, quickly, with rake test:units -- does this make sense? Thanks!

On Mon, Mar 13, 2017 at 12:39 AM, Saurabh Sikchi [email protected] wrote:

@jywarren https://github.com/jywarren Where should the tests for this go?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1331#issuecomment-286014174, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ2WLTShjhA13k6YhbwgAxQUa01XBks5rlMiWgaJpZM4Maf9q .

jywarren avatar Mar 13 '17 15:03 jywarren

Makes complete sense. Thank you very much.

saurabh-sikchi avatar Mar 13 '17 15:03 saurabh-sikchi