Merge pull request #2676 from apple502j/patch-8

Make internal URL clickable
This commit is contained in:
Benjamin Wheeler 2019-01-29 23:28:25 -05:00 committed by GitHub
commit f5134483a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View file

@ -30,16 +30,6 @@ module.exports = (text, opts) => {
)); ));
} }
// Match hashtags
if (opts.hashtags) {
replacedText = reactStringReplace(replacedText, /#([\w-]+)/g, (match, i) => (
<a
href={`/search/projects?q=${match}`}
key={match + i}
>#{match}</a>
));
}
// Match scratch links // Match scratch links
/* /*
Ported from the python... Ported from the python...
@ -71,5 +61,15 @@ module.exports = (text, opts) => {
)); ));
} }
// Match hashtags
if (opts.hashtags) {
replacedText = reactStringReplace(replacedText, /#([\w-]+)/g, (match, i) => (
<a
href={`/search/projects?q=${match}`}
key={match + i}
>#{match}</a>
));
}
return replacedText; return replacedText;
}; };

View file

@ -431,7 +431,7 @@ const PreviewPresentation = ({
{decorateText(projectInfo.instructions, { {decorateText(projectInfo.instructions, {
usernames: true, usernames: true,
hashtags: true, hashtags: true,
scratchLinks: false scratchLinks: true
})} })}
</div> </div>
} }
@ -482,7 +482,7 @@ const PreviewPresentation = ({
{decorateText(projectInfo.description, { {decorateText(projectInfo.description, {
usernames: true, usernames: true,
hashtags: true, hashtags: true,
scratchLinks: false scratchLinks: true
})} })}
</div> </div>
} }