diff --git a/frontend/api.js b/frontend/api.js index 86dbe3ce92ca9414408e9ef8c214440871b05219..e28a6fb967ea399627e7d217dbb148978eb4bdbe 100644 --- a/frontend/api.js +++ b/frontend/api.js @@ -619,7 +619,7 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag var comments = ['']; for (var i in extra['type_field_doc']) comments.push(extra['type_field_doc'][i].length > 1 - ? '//* ' + extra['type_field_doc'][i][1] + ? '//* ' + extra['type_field_doc'][i][1].replace('\n', ' ') : ''); code = mergeComments(code, comments) } @@ -627,7 +627,7 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag var comments = ['']; for (var i in extra['type_constructor_doc']) comments.push(extra['type_constructor_doc'][i].length > 1 - ? '//* ' + extra['type_constructor_doc'][i][1] + ? '//* ' + extra['type_constructor_doc'][i][1].replace('\n', ' ') : ''); code = mergeComments(code, comments) } @@ -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 += '
  • ' + result.problem_solutions[i].markup() + '
  • '; for (var i in result.problem_examples) @@ -727,7 +727,7 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag '
    ' + result.problem_description.markup() + '
    Possible solutions:' + - 'Examples:' + + (examples != '' ? ('Examples:') : '') + 'Edit this explanation on GitHub.' + 'This text is licensed under CC-BY-SA-4.0.' + '
    ' +