Skip to content

Commit

Permalink
Fix empty template and encoding (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme authored Jan 20, 2025
1 parent bbea6cf commit 42bfcc1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/sassc/embedded.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class Engine
remove_method(:render) if public_method_defined?(:render, false)

def render
return @template.dup if @template.empty?

result = ::Sass.compile_string(
@template,
importer: (NoopImporter unless @options[:importer].nil?),
Expand Down Expand Up @@ -53,7 +51,7 @@ def render
end
css += "\n/*# sourceMappingURL=#{source_mapping_url} */"
end
css
css.encode(@template.encoding)
rescue ::Sass::CompileError => e
@loaded_urls = e.loaded_urls

Expand Down

0 comments on commit 42bfcc1

Please sign in to comment.