From: Junio C Hamano Date: Tue, 14 Feb 2012 07:14:22 GMT Subject: Re: [PATCH 6/8] gitweb: Highlight interesting parts of diff Message-ID: <7vpqdh999t.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120214075439.14f1d2b7@mkiedrowicz.ivo.pl> Michal Kiedrowicz writes: > I just started to wonder if we couldn't use output from Jeff's > diff-highlight for gitweb. That could be a sensible approach, but > We could tech diff-highlight to produce diffs > marked with -{} and +{} (this is the notation used by Jeff in one of his > recent patches) or something like this and then just convert that into > HTML markup. this implementation strategy would not work well, given that the payload can contain arbitrary letter sequence (e.g. a Perl script that wants be explicit when writing a hashref literal write +{...} to disambiguate it from a block). If you are going to modularize diff-highlight and reuse it, it needs to learn how to talk HTML to properly escape the payload.