mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -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
|
// 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;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue