Verified Commit 6a5dbf38 authored by Camil Staps's avatar Camil Staps 🚀

Allow multiple @result fields on the frontend (clean-cloogle/Cloogle#9)

parent 593beb00
Subproject commit df9561d23190fc58c221c4c0080e65474d7e4bf7
Subproject commit dda194909330c588b35518672e9413149b92f9d9
......@@ -120,7 +120,7 @@ String.prototype.makeParagraphs = function() {
.split('\n\n').join('<br/>');
}
function makeParametersHTML(name, params) {
function makeDocFieldsHTML(name, params) {
if (params.length == 1)
return name + ': ' + params[0].makeParagraphs();
else
......@@ -399,11 +399,11 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
switch (kind) {
case 'FunctionResult':
if ('param_doc' in extra && extra['param_doc'].length > 0)
hidden.push([makeParametersHTML('Parameter', extra['param_doc'])]);
hidden.push([makeDocFieldsHTML('Parameter', extra['param_doc'])]);
if ('generic_var_doc' in extra && extra['generic_var_doc'].length > 0)
hidden.push([makeParametersHTML('Generic type variable', extra['generic_var_doc'])]);
hidden.push([makeDocFieldsHTML('Generic type variable', extra['generic_var_doc'])]);
if ('result_doc' in extra)
hidden.push(['Result: ' + extra['result_doc']]);
hidden.push([makeDocFieldsHTML('Result', extra['result_doc'])]);
if ('cls' in extra)
meta.push('Class: <code>' +
......
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