From: Junio C Hamano <gitster@pobox.com>
To: Ilya Kantor <iliakan@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] userdiff: fix HTML hunk header regexp
Date: Sun, 24 Sep 2017 10:15:49 +0900 [thread overview]
Message-ID: <xmqqa81kj3qy.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAFU8umjZL0nXUFbuZWVapTaCfAjtAoTT=G3GCKczDE7O8bzAOw@mail.gmail.com> (Ilya Kantor's message of "Sat, 23 Sep 2017 10:53:47 +0300")
Ilya Kantor <iliakan@gmail.com> writes:
> Current HTML header regexp doesn't match headers without attributes.
>
> So it fails to match <h1>...</h1>, while <h1 class="smth">...</h1> matches.
> The fix makes attributes optional.
> The regexp is still far from perfect, but now it at least handles the
> common case.
>
> Signed-off-by: Ilya Kantor <iliakan@gmail.com>
> ---
> userdiff.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/userdiff.c b/userdiff.c
> index 6321103ce..dbfb4e13c 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -38,7 +38,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]+"),
What you sent seems to be whitespace damaged, but it was small
enough for me to tweak it to apply ;-)
Will queue. Thanks.
prev parent reply other threads:[~2017-09-24 1:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-23 7:53 [PATCH] userdiff: fix HTML hunk header regexp Ilya Kantor
2017-09-24 1:15 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa81kj3qy.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=iliakan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).