NL | = | "\r\n" |
NL | = | "\n" |
Null | = | NullNode.instance |
DefaultContext | = | ExpandContext.new |
DefaultHtmlTagInfo | = | HtmlTagInfo.new.freeze |
generate AttrArray object
# File lib/amrita/node.rb, line 706 def a(*x, &block) case x.size when 1 x = x[0] case x when Hash when String,Symbol x = Attr.new(x) when Attr else raise(TypeError, "Not Attr,String or Symbol: #{x}") end AttrArray.new(x, &block) when 0 AttrArray.new([], &block) else a = (0...x.size/2).collect do |i| Attr.new(x[i*2], x[i*2+1]) end AttrArray.new(a, &block) end end
Usually the <> character in text will be escaped.
tmpl = TemplateText.new "<p id=x></p>" tmpl.expand(STDOUT, {:x => "<tag>"}) # => <p><tag></p>
If the text was wrapped by this method, it will no be escaped.
tmpl.expand(STDOUT, {:x => noescape {"<tag>"}}) # => <p><tag></p>
# File lib/amrita/format.rb, line 715 def noescape(&block) Escape.new(false, &block) end