Sha256: 49d18938ef505df2154e6a53c5e75bfd9436102d1102534fed5e2e58dc66fb10
Contents?: true
Size: 491 Bytes
Versions: 40
Compression:
Stored size: 491 Bytes
Contents
# frozen_string_literal: true module Hamlit class Filters class Preserve < Base def compile(node) text = node.value[:text].rstrip + "\n" text = text.gsub("\n", '
') compile_text(text) end private def compile_text(text) if ::Hamlit::HamlUtil.contains_interpolation?(text) [:dynamic, ::Hamlit::HamlUtil.unescape_interpolation(text)] else [:static, text] end end end end end
Version data entries
40 entries across 40 versions & 1 rubygems