From 60dda6d3af1252f98021f2ed490680257f8941d1 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 18 Dec 2014 14:35:01 +0000 Subject: [PATCH] update api docs parser --- static/js/apiDialog.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/static/js/apiDialog.js b/static/js/apiDialog.js index 9d32f86cf..9e018415e 100644 --- a/static/js/apiDialog.js +++ b/static/js/apiDialog.js @@ -132,7 +132,9 @@ pandora.ui.apiDialog = function() { source: string.replace( /\n(?=(takes \{|returns \{|note: |see: ))/g, '\n\n' ).replace( - /(takes|returns|notes|see)(?=( \{|: ))/g, 'BOLD$1BOLD' + /(takes|returns)(?=( \{))/g, 'BOLD$1BOLD' + ).replace( + /(notes:|see:)(?=( ))/g, 'BOLD$1BOLD' ).replace( /`/g, 'BOLD' ) @@ -145,12 +147,12 @@ pandora.ui.apiDialog = function() { $doc.find('.Ox' + type).removeClass('Ox' + type); }); $doc.html( - $doc.html().replace(/BOLD(\w+)BOLD/g, '$1') + $doc.html().replace(/BOLD([\w:]+)BOLD/g, '$1') ); parts = $doc.html().split('notes'); if (parts.length == 2) { parts_ = parts[1].split('see'); - if (len(parts_) == 2) { + if (parts_.length == 2) { parts_[0] = parts_[0].replace(/\n\s+?/g, ' '); parts[1] = parts_.join('see'); } else {