jsdoc/plugins/railsTemplate.js
Jeff Williams 8b26b6d669 remove author tags, and clean up JSDoc comments without leading asterisks
Most of the existing author tags are grossly out of date at this point. The definitive reference for who has contributed what is available at https://github.com/jsdoc3/jsdoc/graphs/contributors.
2017-07-06 00:01:11 -07:00

22 lines
436 B
JavaScript

/**
* Strips the rails template tags from a js.erb file
*
* @module plugins/railsTemplate
*/
'use strict';
exports.handlers = {
/**
* Remove rails tags from the source input (e.g. <% foo bar %>)
*
* @param e
* @param e.filename
* @param e.source
*/
beforeParse: function(e) {
if (e.filename.match(/\.erb$/)) {
e.source = e.source.replace(/<%.*%>/g, '');
}
}
};