Spectrum: @ symbols in medium urls break link detection in threads and messages

Created on 6 Apr 2018  ·  14Comments  ·  Source: withspectrum/spectrum

All 14 comments

@brianlovin If I want to contribute, how do I make sure I am not fixing an issue someone is already fixing? Sorry for spamming here. Could not figure out another way to ask. :)

Not spamming at all! AFAIK nobody is working on this - we should have some sort of label for “claimed”

Ok. Cool. And def yes to a label of sorts. 👍

Thanks.

@nnennajohn I've made a label called 'good first issue (taken)' which can be used if someone commits to tackling an issue :)

@brianlovin Ok. Cool. Let me take this. It will be my first open-source contribution though, so Intentionally looking for the smallest change. :)

Quick question. What would be the general timeline to deliver once you commit?

Not sure! But I'd say if it starts pushing past a few days just ping here and we can try answer questions or pull in more people to help :)

Ok. Perfect. Thank you!

Ok @brianlovin . I tracked down the problem. Sorry, had to navigate my way around the code. But I think the offending thing is the MENTIONS Regex.

I am not quite sure how you want to proceed with it though. Ignore if weburl && regex match? New regex? Extract, but retain current text if weburl and regex match?

screen shot 2018-04-12 at 11 50 56 pm

I think the quickest fix would be to not match a mention if it's preceded by a /, if that makes sense? So the Regexp should match @someone Hello @someone but not /@someone.

Ok Thanks. @mxstbr. Regex is not my strongest point. :)

Tried with an / test prefix, and it works for a full url, but fails for an actual mention. :)

In the below, I expected the third line to evaluate to true. Maybe I am doing it wrong.

screen shot 2018-04-13 at 12 34 45 am

Hey, @nnennajohn are you still working on this? Do you need some help or could I try my hands on this?

@Keraito , hey. For sure. Sadly, my regex skills are really bad. :( Would love to see the final result of what you do with it.

Thank you. I appreciate you hitting me up about this. :)

@mxstbr is there a quick way to run the unit tests in https://github.com/withspectrum/spectrum/blob/alpha/shared/test/get-mentions.test.js in isolated fashion? Just wanna double check my solution but can't setup the whole project right now.

Edit: I tried yarn test shared/test/get-mentions.test.js, but it doesn't work.

@Keraito try yarn run test and then when jest opens up you can specify a regex path pattern (i think the key is p) to run only certain tests :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mxstbr picture mxstbr  ·  5Comments

flaki picture flaki  ·  5Comments

dmitryyankowski picture dmitryyankowski  ·  4Comments

brianlovin picture brianlovin  ·  5Comments

atlx picture atlx  ·  5Comments