Sha256: f4ccfcac7fb7a4ec1d551b578d5f7774d8cb047c5778ce324878b67b90313030
Contents?: true
Size: 1.4 KB
Versions: 12
Compression:
Stored size: 1.4 KB
Contents
# frozen_string_literal: true require 'temple' require 'haml/parser' require 'haml/compiler' require 'haml/html' require 'haml/escapable' require 'haml/force_escapable' require 'haml/dynamic_merger' require 'haml/ambles' module Haml class Engine < Temple::Engine define_options( :buffer_class, generator: Temple::Generators::ArrayBuffer, format: :html, attr_quote: "'", escape_html: true, escape_attrs: true, autoclose: %w(area base basefont br col command embed frame hr img input isindex keygen link menuitem meta param source track wbr), filename: "", disable_capture: false, ) use Parser use Compiler use HTML filter :StringSplitter filter :StaticAnalyzer use Escapable use ForceEscapable filter :ControlFlow use Ambles filter :MultiFlattener filter :StaticMerger use DynamicMerger use :Generator, -> { options[:generator] } end # For backward compatibility of Tilt integration. TODO: We should deprecate this # and let Tilt have a native support of Haml 6. At least it generates warnings now. class TempleEngine < Engine def compile(template) @precompiled = call(template) end def precompiled_with_ambles(_local_names, after_preamble:) "#{after_preamble.tr("\n", ';')}#{@precompiled}".dup end end end
Version data entries
12 entries across 12 versions & 1 rubygems