From 5c27244767c72335e99fb5650312ddf7277d174a Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 18 Dec 2014 14:47:56 +0000 Subject: [PATCH] update api docs parser --- static/js/apiDialog.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/static/js/apiDialog.js b/static/js/apiDialog.js index 1b5ddde01..2e817edbd 100644 --- a/static/js/apiDialog.js +++ b/static/js/apiDialog.js @@ -139,7 +139,9 @@ pandora.ui.apiDialog = function() { }) .css({backgroundColor: 'rgba(0, 0, 0, 0)'}), parts, parts_, - separator = ',' + colon = ':' + + ' '; + comma = ',' + ' '; ['Keyword', 'Method', 'Property'].forEach(function(type) { $doc.find('.Ox' + type).removeClass('Ox' + type); @@ -147,26 +149,26 @@ pandora.ui.apiDialog = function() { $doc.html( $doc.html().replace(/BOLD(\w+)BOLD/g, '$1') ); - parts = $doc.html().split('notes'); + parts = $doc.html().split('notes' + colon); if (parts.length == 2) { - parts_ = parts[1].split('see'); + parts_ = parts[1].split('see' + colon); if (parts_.length == 2) { parts_[0] = parts_[0].replace(/\n\s+?/g, ' '); - parts[1] = parts_.join('see'); + parts[1] = parts_.join('see' + colon); } else { parts[1] = parts[1].replace(/\n\s+?/g, ' '); } - $doc.html(parts.join('notes')); + $doc.html(parts.join('notes' + colon)); } - parts = $doc.html().split('see'); + parts = $doc.html().split('see' + colon); if (parts.length == 2) { - parts[1] = parts[1].replace(/\n\s+?/, '').split(separator).map( + parts[1] = parts[1].replace(/\n\s+?/, '').split(comma).map( function(action) { return '' + action + ''; } - ).join(separator); - $doc.html(parts.join('see')); + ).join(comma); + $doc.html(parts.join('see' + colon)); } pandora.createLinks($doc); return $doc;