UNPKG

416 BPlain TextView Raw
1/**
2 * Strips the rails template tags from a js.erb file
3 *
4 * @module plugins/railsTemplate
5 */
6
7exports.handlers = {
8 /**
9 * Remove rails tags from the source input (e.g. <% foo bar %>)
10 * @param e
11 * @param e.filename
12 * @param e.source
13 */
14 beforeParse: function(e) {
15 if (e.filename.match(/\.erb$/)) {
16 e.source = e.source.replace(/<%.*%> /g, "");
17 }
18 }
19};
20
\No newline at end of file