diff --git a/plugins/railsTemplate.js b/plugins/railsTemplate.js new file mode 100644 index 00000000..cb046f99 --- /dev/null +++ b/plugins/railsTemplate.js @@ -0,0 +1,20 @@ +/** + @overview Strips the rails template tags from a js.erb file + @module plugins/railsTemplate + @author Jannon Frank + */ + + +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, ""); + } + } +}; \ No newline at end of file