From f989b5bd1a81fa7f7963bdb1adeddb33d87aa2d0 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 18 Dec 2014 12:34:00 +0000 Subject: [PATCH] update doc parser regexp --- static/js/apiDialog.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/js/apiDialog.js b/static/js/apiDialog.js index 8c836c870..544beeaa6 100644 --- a/static/js/apiDialog.js +++ b/static/js/apiDialog.js @@ -167,15 +167,18 @@ pandora.ui.apiDialog = function() { that.select = function(id) { if (id && actions[id]) { - $text.html('

' + id + '


'); + $text.html('

' + id + '


'); var code = actions[id].code[1], source = actions[id].code[0], line = Math.round(Ox.last(source.split(':')) || 0), - doc = actions[id].doc.replace('/\n/
\n/g'), + doc = actions[id].doc.replace(/\n(?=(takes|returns) \{)/g, '\n\n'), $code, $doc; $doc = Ox.SyntaxHighlighter({ source: doc, }) + .css({ + backgroundColor: 'rgba(0, 0, 0, 0)' + }) .appendTo($text); ['Keyword', 'Method', 'Property'].forEach(function(type) { $doc.find('.Ox' + type).removeClass('Ox' + type); @@ -185,9 +188,9 @@ pandora.ui.apiDialog = function() { .appendTo($text); $code = Ox.SyntaxHighlighter({ source: code.replace(/\s*?'''[\s\S]+?'''/g, ''), - offset: line }) .css({ + backgroundColor: 'rgba(0, 0, 0, 0)', borderWidth: '1px', }) .appendTo($text);