mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
cleanup
This commit is contained in:
parent
e17b785a43
commit
7ac6bfee1c
@ -12,6 +12,20 @@ var parse = require('jsdoc/util/markdown').getParser();
|
||||
var tags = [];
|
||||
var excludeTags = [];
|
||||
|
||||
function shouldProcessString(tagName, text) {
|
||||
var shouldProcess = false;
|
||||
|
||||
if (tagName !== 'see') {
|
||||
shouldProcess = true;
|
||||
}
|
||||
// we only want to process `@see` tags that contain Markdown links
|
||||
else if (tagName === 'see' && text.indexOf('[') !== -1) {
|
||||
shouldProcess = true;
|
||||
}
|
||||
|
||||
return shouldProcess;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the markdown source in a doclet. The properties that should be
|
||||
* processed are configurable, but always include "classdesc", "description",
|
||||
@ -24,13 +38,10 @@ function process(doclet) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof doclet[tag] === "string" &&
|
||||
(tag != 'see' ||
|
||||
// treat '@see' specially, since we only want to process @see text that contains links
|
||||
(tag == 'see' && doclet[tag].indexOf('[') != -1))) {
|
||||
if (typeof doclet[tag] === "string" && shouldProcessString(tag, doclet[tag]) ) {
|
||||
doclet[tag] = parse(doclet[tag]);
|
||||
}
|
||||
else if (doclet[tag] instanceof Array) {
|
||||
else if ( Array.isArray(doclet[tag]) ) {
|
||||
doclet[tag].forEach(function(value, index, original) {
|
||||
var inner = {};
|
||||
inner[tag] = value;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user