Port of erubi. Mostly identical to original erubi, but slightly modified for mruby compatibility.
- add conf.gem line to
build_config.rb
MRuby::Build.new do |conf|
# ... (snip) ...
conf.gem :github => 'genya0407/mruby-erubi'
end
hoge = '<script>while (true) { alert("This is infinit!"); }</script>'
template = '<%= hoge %>'
# You can escape HTML string by `escape` option
src = Erubi::Engine.new(template, escape: true).src
eval(src) #=> '<script>while (true) { alert("This is infinit!"); }</script>'
under the MIT License:
- see LICENSE file