dgeni-packages
Version:
A collection of dgeni packages for generating documentation from source code
17 lines (16 loc) • 585 B
JavaScript
/**
* @dgProcessor unescapeCommentsProcessor
* @description
* Some files (like CSS) use the same comment markers as the jsdoc comments, such as /*.
* To get around this we HTML encode them in the source.
* This processor unescapes them back to normal comment markers
*/
module.exports = function unescapeCommentsProcessor() {
return {
$runAfter: ['docs-rendered'],
$runBefore: ['writing-files'],
$process(docs) {
docs.forEach(doc => doc.renderedContent = doc.renderedContent.replace(/\/*/g, '/*').replace(/*\//g, '*/'));
}
};
};