Skip to content

Commit

Permalink
Fix protected check in Gettext.Extractor (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
feng19 authored Mar 1, 2023
1 parent 3d16882 commit da71fb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/gettext/extractor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -422,5 +422,5 @@ defmodule Gettext.Extractor do
do: false

defp protected?(%{references: refs}, pattern),
do: Enum.any?(refs, fn {path, _} -> Regex.match?(pattern, path) end)
do: refs |> List.flatten() |> Enum.any?(fn {path, _} -> Regex.match?(pattern, path) end)
end
2 changes: 1 addition & 1 deletion test/gettext/extractor_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ defmodule Gettext.ExtractorTest do
message_1 = %Message.Singular{
msgid: ["foo"],
msgstr: ["bar"],
references: [{"foo.ex", 1}],
references: [[{"foo.ex", 1}, {"bar.ex", 1}], [{"baz.ex", 1}]],
flags: [["elixir-autogen", "elixir-format"]]
}

Expand Down

0 comments on commit da71fb6

Please sign in to comment.