def create_converter
converter_opts = {}
converter_opts[:htmlsyntax] = @attributes['htmlsyntax']
template_dirs = if (template_dir = @options[:template_dir])
converter_opts[:template_dirs] = [template_dir]
elsif (template_dirs = @options[:template_dirs])
converter_opts[:template_dirs] = template_dirs
end
if template_dirs
converter_opts[:template_cache] = @options.fetch :template_cache, true
converter_opts[:template_engine] = @options[:template_engine]
converter_opts[:template_engine_options] = @options[:template_engine_options]
converter_opts[:eruby] = @options[:eruby]
converter_opts[:safe] = @safe
end
if (converter = @options[:converter])
converter_factory = Converter::Factory.new ::Hash[backend, converter]
else
converter_factory = Converter::Factory.default false
end
converter_factory.create backend, converter_opts
end