From 0aaee99533743e4aa2261485657f7cadf0f1c04b Mon Sep 17 00:00:00 2001 From: Jannon Date: Mon, 23 Apr 2012 19:26:46 -0700 Subject: [PATCH] =?UTF-8?q?A=20plugin=20that=20removes=20<%=E2=80=A6%>=20t?= =?UTF-8?q?ags=20from=20.erb=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/railsTemplate.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/railsTemplate.js 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