mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
21 lines
631 B
JavaScript
21 lines
631 B
JavaScript
/**
|
|
@overview Translate doclet descriptions from MarkDown into HTML.
|
|
@module plugins/markdown
|
|
@author Michael Mathews <micmath@gmail.com>
|
|
*/
|
|
|
|
var mdParser = require('evilstreak/markdown');
|
|
|
|
/**
|
|
Translate markdown syntax in a new doclet's description into HTML. Is run
|
|
by JSDoc 3 whenever a "newDoclet" event fires.
|
|
*/
|
|
exports.newDoclet = function(e) {
|
|
if (e.doclet.description) {
|
|
e.doclet.description = mdParser.toHTML(e.doclet.description)
|
|
.replace( /&/g, "&" ) // because markdown escapes these
|
|
.replace( /</g, "<" )
|
|
.replace( />/g, ">" );
|
|
}
|
|
};
|