Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
userdiff: fix HTML hunk header regexp
author
Ilya Kantor
<iliakan@gmail.com>
Sat, 23 Sep 2017 07:53:47 +0000
(10:53 +0300)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 24 Sep 2017 01:13:28 +0000
(10:13 +0900)
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>
userdiff.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
3d9c5b5
)
diff --git
a/userdiff.c
b/userdiff.c
index 2125d6da26dbdc01f7397415ef1f67616e6f2a71..4a0e5202e489bc5254fa4c621ca470d362005748 100644
(file)
--- 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"