We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Right now, when you use a hashtag like #sampling on PublicLab.org, you get a link to the corresponding tag page, https://publiclab.org/tag/sampling.
#sampling
If you use a number like #123, you likewise get linked to ../tag/123.
#123
../tag/123
But this would be a good opportunity to link that to the node with matching ID -- like, for example, https://publiclab.org/n/99 for #99
#99
The regular expression code to find numbers is here:
https://github.com/publiclab/plots2/blob/master/config/initializers/constants.rb#L3
We should exclude just numbers -- so while this should work:
#hello-2
This should not match:
This last #99 should instead be matched by a new one that does /not/ match any letters.
To try these out, you can use http://Rubular.com, using the test string:
#99 #hello-2 #hello
Then, each place we do the substitution should be added to so we replace the numerical ones too:
https://github.com/publiclab/plots2/search?utf8=%E2%9C%93&q=Callouts.const_get(:HASHTAG)
The text was updated successfully, but these errors were encountered:
@jywarren sir...can i take this ?
Sorry, something went wrong.
Get numerical hashes like #123 to link to notes, not generate tag links
dd2f01b
#1825 (#1826) * Updated constant.rb * Updated answer.rb * Updated comment.rb * Updated revision.rb * Added Test for HASHTAGNUMBER regex
Get numerical hashes like publiclab#123 to link to notes, not generat…
250e4d9
…e tag links publiclab#1825 (publiclab#1826) * Updated constant.rb * Updated answer.rb * Updated comment.rb * Updated revision.rb * Added Test for HASHTAGNUMBER regex
No branches or pull requests
Please describe the problem (or idea)
Right now, when you use a hashtag like
#sampling
on PublicLab.org, you get a link to the corresponding tag page, https://publiclab.org/tag/sampling.If you use a number like
#123
, you likewise get linked to../tag/123
.But this would be a good opportunity to link that to the node with matching ID -- like, for example, https://publiclab.org/n/99 for
#99
Solution
The regular expression code to find numbers is here:
https://github.com/publiclab/plots2/blob/master/config/initializers/constants.rb#L3
We should exclude just numbers -- so while this should work:
#hello-2
This should not match:
#99
This last
#99
should instead be matched by a new one that does /not/ match any letters.To try these out, you can use http://Rubular.com, using the test string:
Then, each place we do the substitution should be added to so we replace the numerical ones too:
https://github.com/publiclab/plots2/search?utf8=%E2%9C%93&q=Callouts.const_get(:HASHTAG)
The text was updated successfully, but these errors were encountered: