mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Check hashtag after URL
This commit is contained in:
parent
7937611272
commit
ea9282a3eb
1 changed files with 10 additions and 10 deletions
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue