require "amrita/template" include Amrita tmpl = TemplateText.new %q[
xxx
] data = { :body=>"I want to insert new line.I want to insert new line.<br>But I can't
puts data = { :body=>noescape { "I can insert new lineI can insert new line
with escape { ... }
But it may be dangerous
But amrita sanitize it!
:body=>a(:yyy=>%q[">XSS attack hereBut amrita sanitize it!
puts tmpl = TemplateText.new %q[href is treated in a special way] data = { :body=>a(:href=>%q[javascript:alert('hello')]) } tmpl.expand(STDOUT, data) # href is treated in a special way puts