diff --git a/main.go b/main.go
index b7ad0b8..18bb5a4 100644
--- a/main.go
+++ b/main.go
@@ -359,7 +359,7 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by
".wxi", ".wxl", ".wxs",
".xml":
lic, err = executeTemplate(tmpl, data, "")
- case ".j2":
+ case ".j2", ".jinja2", ".jinja":
lic, err = executeTemplate(tmpl, data, "{#", "", "#}")
case ".ml", ".mli", ".mll", ".mly":
lic, err = executeTemplate(tmpl, data, "(**", " ", "*)")
diff --git a/main_test.go b/main_test.go
index 5aa7648..5adb4ed 100644
--- a/main_test.go
+++ b/main_test.go
@@ -399,7 +399,7 @@ func TestLicenseHeader(t *testing.T) {
},
{
[]string{
- ".j2",
+ "f.j2", "f.jinja2", "f.jinja",
},
"{#\nHYS\n#}\n\n",
},
diff --git a/testdata/expected/file.j2 b/testdata/expected/file.j2
new file mode 100644
index 0000000..d33372d
--- /dev/null
+++ b/testdata/expected/file.j2
@@ -0,0 +1,34 @@
+
+{#
+Copyright 2018 Google LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+
+
+
+ My Webpage
+
+
+
+
+ My Webpage
+ {{ a_variable }}
+
+ {# a comment #}
+
+
\ No newline at end of file
diff --git a/testdata/expected/file.jinja b/testdata/expected/file.jinja
new file mode 100644
index 0000000..d33372d
--- /dev/null
+++ b/testdata/expected/file.jinja
@@ -0,0 +1,34 @@
+
+{#
+Copyright 2018 Google LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+
+
+
+ My Webpage
+
+
+
+
+ My Webpage
+ {{ a_variable }}
+
+ {# a comment #}
+
+
\ No newline at end of file
diff --git a/testdata/expected/file.jinja2 b/testdata/expected/file.jinja2
new file mode 100644
index 0000000..d33372d
--- /dev/null
+++ b/testdata/expected/file.jinja2
@@ -0,0 +1,34 @@
+
+{#
+Copyright 2018 Google LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+
+
+
+ My Webpage
+
+
+
+
+ My Webpage
+ {{ a_variable }}
+
+ {# a comment #}
+
+
\ No newline at end of file
diff --git a/testdata/initial/file.j2 b/testdata/initial/file.j2
new file mode 100644
index 0000000..e566be4
--- /dev/null
+++ b/testdata/initial/file.j2
@@ -0,0 +1,18 @@
+
+
+
+ My Webpage
+
+
+
+
+ My Webpage
+ {{ a_variable }}
+
+ {# a comment #}
+
+
\ No newline at end of file
diff --git a/testdata/initial/file.jinja b/testdata/initial/file.jinja
new file mode 100644
index 0000000..e566be4
--- /dev/null
+++ b/testdata/initial/file.jinja
@@ -0,0 +1,18 @@
+
+
+
+ My Webpage
+
+
+
+
+ My Webpage
+ {{ a_variable }}
+
+ {# a comment #}
+
+
\ No newline at end of file
diff --git a/testdata/initial/file.jinja2 b/testdata/initial/file.jinja2
new file mode 100644
index 0000000..e566be4
--- /dev/null
+++ b/testdata/initial/file.jinja2
@@ -0,0 +1,18 @@
+
+
+
+ My Webpage
+
+
+
+
+ My Webpage
+ {{ a_variable }}
+
+ {# a comment #}
+
+
\ No newline at end of file