Skip to content

Commit

Permalink
Merge pull request #119 from iainbeeston/patch-1
Browse files Browse the repository at this point in the history
Only pass template language to parser
  • Loading branch information
rafaelfranca authored Mar 14, 2024
2 parents 685cfca + 03c317c commit 2a94d6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class ErbSafetyTest < ActiveSupport::TestCase
Dir[ERB_GLOB].each do |filename|
pathname = Pathname.new(filename).relative_path_from(Rails.root)
test "missing javascript escapes in #{pathname}" do
assert_erb_safety File.read(filename)
assert_erb_safety(File.read(filename), filename:)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/better_html/test_helper/safe_erb_tester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def assert_erb_safety(data, **options)
options[:template_language] ||= :html
buffer = ::Parser::Source::Buffer.new(options[:filename] || "(buffer)")
buffer.source = data
parser = BetterHtml::Parser.new(buffer, **options)
parser = BetterHtml::Parser.new(buffer, template_language: options[:template_language])

tester_classes = [
SafeErb::NoStatements,
Expand Down

0 comments on commit 2a94d6e

Please sign in to comment.