Skip to content
Snippets Groups Projects
Commit a15084a7 authored by Anthony's avatar Anthony
Browse files

Fix double line break issue in json comment

parent 4cde5b27
No related branches found
No related tags found
No related merge requests found
Pipeline #2068 passed
...@@ -12,9 +12,14 @@ function checkAllQuestions(questions, surveyConfig, converter) { ...@@ -12,9 +12,14 @@ function checkAllQuestions(questions, surveyConfig, converter) {
if (allCorrect) { if (allCorrect) {
correctIndic.node.className = "correct"; correctIndic.node.className = "correct";
// convert \n\n into <br> tags for HTML rendering
surveyConfig.correctComment = surveyConfig.correctComment.replace(/\n\n/g, "<br>");
correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.correctComment) || "All answers are correct!"; correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.correctComment) || "All answers are correct!";
} else { } else {
correctIndic.node.className = "incorrect"; correctIndic.node.className = "incorrect";
// convert \n\n into <br> tags for HTML rendering
surveyConfig.incorrectComment = surveyConfig.incorrectComment.replace(/\n\n/g, "<br>");
correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.incorrectComment) || "Some answers are incorrect!"; correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.incorrectComment) || "Some answers are incorrect!";
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment