mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
Merge pull request #2676 from apple502j/patch-8
Make internal URL clickable
This commit is contained in:
commit
f5134483a3
2 changed files with 12 additions and 12 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
|
||||
/*
|
||||
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;
|
||||
};
|
||||
|
|
|
@ -431,7 +431,7 @@ const PreviewPresentation = ({
|
|||
{decorateText(projectInfo.instructions, {
|
||||
usernames: true,
|
||||
hashtags: true,
|
||||
scratchLinks: false
|
||||
scratchLinks: true
|
||||
})}
|
||||
</div>
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ const PreviewPresentation = ({
|
|||
{decorateText(projectInfo.description, {
|
||||
usernames: true,
|
||||
hashtags: true,
|
||||
scratchLinks: false
|
||||
scratchLinks: true
|
||||
})}
|
||||
</div>
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue