Skip to content

Commit 9c03cac

Browse files
iliakangitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3d9c5b5 commit 9c03cac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

userdiff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ IPATTERN("fortran",
3737
"|//|\\*\\*|::|[/<>=]="),
3838
IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$",
3939
"[^ \t-]+"),
40-
PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
40+
PATTERNS("html", "^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$",
4141
"[^<>= \t]+"),
4242
PATTERNS("java",
4343
"!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"

0 commit comments

Comments
 (0)