diff --git a/lib/gettext/extractor.ex b/lib/gettext/extractor.ex index 46d78057..a29bf2a1 100644 --- a/lib/gettext/extractor.ex +++ b/lib/gettext/extractor.ex @@ -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 diff --git a/test/gettext/extractor_test.exs b/test/gettext/extractor_test.exs index 60df837e..ba885825 100644 --- a/test/gettext/extractor_test.exs +++ b/test/gettext/extractor_test.exs @@ -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"]] }