We planned to upgrade GitLab and Mattermost to the latest version this Friday morning (early). You may experience some downtime!

Commit 21b3cfaf authored by Camil Staps's avatar Camil Staps 🚀

Common problems: don't show examples header when there are no examples

parent 9da8fbb0
......@@ -714,7 +714,7 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
case 'ProblemResult':
result = result[1];
var solutions = '', examples = [];
var solutions = '', examples = '';
for (var i in result.problem_solutions)
solutions += '<li>' + result.problem_solutions[i].markup() + '</li>';
for (var i in result.problem_examples)
......@@ -727,7 +727,7 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
'<div class="result-extra result-extra-space">' +
result.problem_description.markup() +
'<br class="parbreak"/>Possible solutions:<ul>' + solutions + '</ul>' +
'Examples:<ul>' + examples + '</ul>' +
(examples != '' ? ('Examples:<ul>' + examples + '</ul>') : '') +
'<a href="https://github.com/clean-cloogle/common-problems/blob/master/' + result.problem_key + '.md" target="_blank">Edit this explanation on GitHub.</a>' +
'<span class="problem-license">This text is licensed under <a href="https://github.com/clean-cloogle/common-problems/blob/master/LICENSE" target="_blank">CC-BY-SA-4.0</a>.</span>' +
'</div>' +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment