From: Ilya Kantor Date: Sat, 23 Sep 2017 07:53:47 +0000 (+0300) Subject: userdiff: fix HTML hunk header regexp X-Git-Tag: v2.15.0-rc0~44^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c03caca2c40870cf7f879d18e55db1c94877cd5;p=git userdiff: fix HTML hunk header regexp Current HTML header regexp doesn't match headers without attributes. So it fails to match

...

, while

...

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 Signed-off-by: Junio C Hamano --- diff --git a/userdiff.c b/userdiff.c index 2125d6da26..4a0e5202e4 100644 --- a/userdiff.c +++ b/userdiff.c @@ -37,7 +37,7 @@ IPATTERN("fortran", "|//|\\*\\*|::|[/<>=]="), IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$", "[^ \t-]+"), -PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$", +PATTERNS("html", "^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$", "[^<>= \t]+"), PATTERNS("java", "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"