From ae5d2bfd475eaab3f8939afe2ba7ec0d91430d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Mon, 7 Nov 2022 20:36:37 -0800 Subject: [PATCH] Support sass-embedded (#196) --- lib/hamlit/filters/tilt_base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/hamlit/filters/tilt_base.rb b/lib/hamlit/filters/tilt_base.rb index cb7e1d49..b10fd00e 100644 --- a/lib/hamlit/filters/tilt_base.rb +++ b/lib/hamlit/filters/tilt_base.rb @@ -7,7 +7,11 @@ class TiltBase < Base def self.render(name, source, indent_width: 0) text = ::Tilt["t.#{name}"].new { source }.render return text if indent_width == 0 - text.gsub!(/^/, ' ' * indent_width) + if text.frozen? + text.gsub(/^/, ' ' * indent_width) + else + text.gsub!(/^/, ' ' * indent_width) + end end def explicit_require?(needed_registration)