Skip to content

Commit

Permalink
Merge pull request #30 from zooniverse-ui/fix-hashtag-links
Browse files Browse the repository at this point in the history
Fix hashtag links to correctly go to the hashtag results, and not...
  • Loading branch information
amyrebecca committed Jan 18, 2016
2 parents 8d96b23 + 29d510c commit 8ff4e0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/default-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function(input, {project, baseURI}) {
// hashtags #tagname
.replace(/(?!\B.*\/+\b)\B#(\b[\w+-\/]+\b)/g, function(fullTag, tagName) {
if (owner && name) {
return `[${fullTag}](${baseURI}/projects/${owner}/${name}/talk/search?query=${tagName})`
return `[${fullTag}](${baseURI}/projects/${owner}/${name}/talk/tags/${tagName})`
}
else {
return `[${fullTag}](${baseURI}/talk/search?query=${tagName})`
Expand Down
2 changes: 1 addition & 1 deletion test/lib/default-transformer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('default-transformer', () => {
it('replaces project #hashtag mentions with project links', () =>{
project = { slug: "test/project" };
const subjectLink = replaceSymbols('#S123456', {project, baseURI});;
expect(subjectLink).to.equal('[#S123456](/projects/test/project/talk/search?query=S123456)');
expect(subjectLink).to.equal('[#S123456](/projects/test/project/talk/tags/S123456)');
});


Expand Down

0 comments on commit 8ff4e0f

Please sign in to comment.