var inlineLex = require('jsdoc-inline-lex');
/**
* Format link & tutorial tags with simple code inline tags.
*
* @param {string} text input - typically a description
* @returns {string} markdown-friendly output
* @private
* @example
* formatInlineTags('{@link Foo}'); // "`Foo`"
*/
function formatInlineTags(text) {
var output = '';
var tokens = inlineLex(text);
for (var i = 0; i < tokens.length; i++) {
if (tokens[i].type === 'text') {
output += tokens[i].capture[0];
} else {
output += '`' + tokens[i].capture[1] + '`';
}
}
return output;
}
module.exports = formatInlineTags;
|