userdiff: fix HTML hunk header regexp

Current HTML header regexp doesn't match headers without attributes. So it fails to match <h1>...</h1>, while <h1 class="smth">...</h1> matches. Make attributes optional to fix this. The regexp is still far from perfect, but now it at least handles the common case. Signed-off-by: Ilya Kantor <iliakan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ilya Kantor committed Sep 23, 2017 at 10:53 UTC 9c03caca2c40870cf7f879d18e55db1c94877cd5
1 file changed +1 -1
userdiff.c
+1 -1
@@ -37,7 +37,7 @@ IPATTERN("fortran",
37 "|//|\\*\\*|::|[/<>=]="),
38 IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
39 "[^ \t-]+"),
40 -PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
40 +PATTERNS("html", "^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$",
41 "[^<>= \t]+"),
42 PATTERNS("java",
43 "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"