From 7937611272a9a1867a8f216c699af860ff760cdf Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Tue, 15 Jan 2019 14:34:17 +0900 Subject: [PATCH 1/2] Make internal URL clickable --- src/views/preview/presentation.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/preview/presentation.jsx b/src/views/preview/presentation.jsx index a13ed21aa..bb925fb57 100644 --- a/src/views/preview/presentation.jsx +++ b/src/views/preview/presentation.jsx @@ -393,7 +393,7 @@ const PreviewPresentation = ({ {decorateText(projectInfo.instructions, { usernames: true, hashtags: true, - scratchLinks: false + scratchLinks: true })} } @@ -436,7 +436,7 @@ const PreviewPresentation = ({ {decorateText(projectInfo.description, { usernames: true, hashtags: true, - scratchLinks: false + scratchLinks: true })} } From ea9282a3eb4548064ae8a23c6d9bb26490519c79 Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Wed, 16 Jan 2019 09:15:58 +0900 Subject: [PATCH 2/2] Check hashtag after URL --- src/lib/decorate-text.jsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/decorate-text.jsx b/src/lib/decorate-text.jsx index 78ebec51f..f2df260a2 100644 --- a/src/lib/decorate-text.jsx +++ b/src/lib/decorate-text.jsx @@ -30,16 +30,6 @@ module.exports = (text, opts) => { )); } - // Match hashtags - if (opts.hashtags) { - replacedText = reactStringReplace(replacedText, /#([\w-]+)/g, (match, i) => ( - #{match} - )); - } - // 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) => ( + #{match} + )); + } + return replacedText; };