update api docs parser

This commit is contained in:
rolux 2014-12-18 14:35:01 +00:00
parent 72830e70b8
commit 60dda6d3af

View file

@ -132,7 +132,9 @@ pandora.ui.apiDialog = function() {
source: string.replace( source: string.replace(
/\n(?=(takes \{|returns \{|note: |see: ))/g, '\n\n' /\n(?=(takes \{|returns \{|note: |see: ))/g, '\n\n'
).replace( ).replace(
/(takes|returns|notes|see)(?=( \{|: ))/g, 'BOLD$1BOLD' /(takes|returns)(?=( \{))/g, 'BOLD$1BOLD'
).replace(
/(notes:|see:)(?=( ))/g, 'BOLD$1BOLD'
).replace( ).replace(
/`/g, 'BOLD' /`/g, 'BOLD'
) )
@ -145,12 +147,12 @@ pandora.ui.apiDialog = function() {
$doc.find('.Ox' + type).removeClass('Ox' + type); $doc.find('.Ox' + type).removeClass('Ox' + type);
}); });
$doc.html( $doc.html(
$doc.html().replace(/BOLD(\w+)BOLD/g, '<b>$1</b>') $doc.html().replace(/BOLD([\w:]+)BOLD/g, '<b>$1</b>')
); );
parts = $doc.html().split('<b>notes</b>'); parts = $doc.html().split('<b>notes</b>');
if (parts.length == 2) { if (parts.length == 2) {
parts_ = parts[1].split('<b>see</b>'); parts_ = parts[1].split('<b>see</b>');
if (len(parts_) == 2) { if (parts_.length == 2) {
parts_[0] = parts_[0].replace(/\n\s+?/g, ' '); parts_[0] = parts_[0].replace(/\n\s+?/g, ' ');
parts[1] = parts_.join('<b>see</b>'); parts[1] = parts_.join('<b>see</b>');
} else { } else {