doc: skip type parsing inside code blocks

Since types are denoted with curly braces it can cause erroneous
replaces in code blocks.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
Vladimir Kurchatkin 2013-12-25 19:59:25 +04:00 committed by Trevor Norris
parent c7f5c98ee9
commit 103b89673e

View File

@ -122,9 +122,15 @@ function parseLists(input) {
function parseListItem(text) {
text = text.replace(/\{([^\}]+)\}/, '<span class="type">$1</span>');
var parts = text.split('`');
var i;
for (i = 0; i < parts.length; i += 2) {
parts[i] = parts[i].replace(/\{([^\}]+)\}/, '<span class="type">$1</span>');
}
//XXX maybe put more stuff here?
return text;
return parts.join('`');
}
function parseAPIHeader(text) {