Module: Jekyll::HamlHelpers

Defined in:
lib/jekyll/haml_helpers.rb

Instance Method Summary collapse

Instance Method Details

#h(text) ⇒ Object



6
7
8
# File 'lib/jekyll/haml_helpers.rb', line 6

def h(text)
  CGI.escapeHTML(text)
end


10
11
12
13
14
# File 'lib/jekyll/haml_helpers.rb', line 10

def link_to(text, url, attributes = {})
  attributes = { :href => url }.merge(attributes)
  attributes = attributes.map {|key, value| %{#{key}="#{h value}"} }.join(" ")
  "<a #{attributes}>#{text}</a>"
end