Check hashtag after URL

This commit is contained in:
apple502j 2019-01-16 09:15:58 +09:00 committed by GitHub
parent 7937611272
commit ea9282a3eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
}; };