Module: Hx::Output::LiquidTemplate::TextFilters

Defined in:
lib/hx/output/liquidtemplate.rb

Instance Method Summary collapse

Instance Method Details

#escape_url(input) ⇒ Object



41
42
43
# File 'lib/hx/output/liquidtemplate.rb', line 41

def escape_url(input)
  CGI.escape(input)
end

#escape_xml(input) ⇒ Object



45
46
47
# File 'lib/hx/output/liquidtemplate.rb', line 45

def escape_xml(input)
  CGI.escapeHTML(input)
end

#handleize(input) ⇒ Object



53
54
55
# File 'lib/hx/output/liquidtemplate.rb', line 53

def handleize(input)
  "id_#{input.to_s.gsub(/[^A-Za-z0-9]/, '_')}"
end

#path_to_url(input, base_url) ⇒ Object



49
50
51
# File 'lib/hx/output/liquidtemplate.rb', line 49

def path_to_url(input, base_url)
  "#{base_url}#{input}"
end

#textilize(input) ⇒ Object



37
38
39
# File 'lib/hx/output/liquidtemplate.rb', line 37

def textilize(input)
  RedCloth.new(input).to_html
end

#xsd_datetime(input) ⇒ Object



57
58
59
60
# File 'lib/hx/output/liquidtemplate.rb', line 57

def xsd_datetime(input)
  input = Time.parse(input) unless Time === input
  input.xmlschema
end