From e727acb281518de286adc7c33bcce5402b03338f Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Fri, 15 Feb 2019 17:51:43 +0300 Subject: [PATCH] fix: do not render empty instructions --- .../Challenges/components/Challenge-Description.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/templates/Challenges/components/Challenge-Description.js b/client/src/templates/Challenges/components/Challenge-Description.js index 284a318c61..fb0385a5c2 100644 --- a/client/src/templates/Challenges/components/Challenge-Description.js +++ b/client/src/templates/Challenges/components/Challenge-Description.js @@ -9,19 +9,22 @@ const propTypes = { section: PropTypes.string }; +function emptyInstruction(instructions) { + return (/^\s*<\/section>$/) + .test(instructions); +} + function ChallengeDescription({ description, instructions, section }) { return (
- {instructions ? ( + {!emptyInstruction(instructions) && (
-
- ) : ( -
)} +
); }