# File lib/jpmobile/filter.rb, line 52 def to_external(str, options = {}) unless options[:input] filter(str, @@internal, @@external) else encoding = (str =~ /^\s*<[^Hh>]*html/) and str.respond_to?(:encoding) nokogiri_klass = (str =~ /^\s*<[^Hh>]*html/) ? Nokogiri::HTML::Document : Nokogiri::HTML::DocumentFragment doc = if encoding nokogiri_klass.parse(str, nil, "UTF-8") else nokogiri_klass.parse(str) end doc = convert_text_content(doc) doc.to_html end end