lib/immunio/plugins/action_view/template.rb in immunio-2.0.2 vs lib/immunio/plugins/action_view/template.rb in immunio-2.0.3
- old
+ new
@@ -288,12 +288,10 @@
rendered = mark_var rendered, code, template_id, template_sha, file, line, escape, is_text, handler
rendered.html_safe
end
def remove_comment(code)
- *, last_line = code.rpartition("\n")
-
- comment = Ripper.slice(last_line, "comment")
+ comment = Ripper.slice(code, "comment")
if comment
code = code.sub(Regexp.new(Regexp.escape(comment) + "\\Z"), "")
end