class Thymeleaf::Parser

Public Instance Methods

call() click to toggle source
# File lib/thymeleaf/parser.rb, line 7
def call
  if /^\s*(?:\s*<!--[^>]*-->)*\s*<(?:html|!doctype)/i.match(template_markup)
    Nokogiri::HTML(template_markup, Thymeleaf.configuration.parser.encoding)
  else
    Nokogiri::HTML::fragment(template_markup, Thymeleaf.configuration.parser.encoding)
  end
end