From: Jakub Narebski Date: Mon, 13 Feb 2012 19:58:17 GMT Subject: Re: [PATCH 6/8] gitweb: Highlight interesting parts of diff Message-ID: <201202132058.18001.jnareb@gmail.com> In-Reply-To: <20120213075451.1bc20885@mkiedrowicz.ivo.pl> Michal Kiedrowicz wrote: > Jakub Narebski wrote: > > Jakub Narebski writes: [...] > > > Anyway I have send to git mailing list a patch series, which in one > > > of patches adds esc_html_match_hl($str, $regexp) to highlight > > > matches in a string. > > Yeah, I saw that but after seeing that they accept different arguments > I decided to leave them alone. > > > > Your esc_html_mark_range(), after a > > > generalization, could be used as underlying "engine". > > > > > > Something like this, perhaps (untested): > > I think I'll leave it to you after merging both these series to > master :) Yes, you are right. Let's do it when we actually need it. [...] > > > # Highlight selected fragments of string, using given CSS class, > > > # and escape HTML. It is assumed that fragments do not overlap. > > > # Regions are passed as list of pairs (array references). > > > sub esc_html_hl { [...] > > Actually we can accomodate both operating on string and operating on > > array of characters in a single subroutine. Though it can be left for > > later commit, anyway... -- Jakub Narebski Poland