From: "J.H." <warthog9@eaglescrag.net>
To: "Christopher M. Fuhrman" <cfuhrman@panix.com>
Cc: git@vger.kernel.org, jnareb@gmail.com, cwilson@cdwilson.us,
sylvain@abstraction.fr
Subject: Re: [PATCH/RFC] gitweb: highlight: strip non-printable characters via col(1)
Date: Tue, 16 Aug 2011 13:30:22 -0700 [thread overview]
Message-ID: <4E4AD35E.8060907@eaglescrag.net> (raw)
In-Reply-To: <1313518605-26460-1-git-send-email-cfuhrman@panix.com>
On 08/16/2011 11:16 AM, Christopher M. Fuhrman wrote:
> From: "Christopher M. Fuhrman" <cfuhrman@panix.com>
>
> The current code, as is, passes control characters, such as form-feed
> (^L) to highlight which then passes it through to the browser. This
> will cause the browser to display one of the following warnings:
>
> Safari v5.1 (6534.50) & Google Chrome v13.0.782.112:
>
> This page contains the following errors:
>
> error on line 657 at column 38: PCDATA invalid Char value 12
> Below is a rendering of the page up to the first error.
>
> Mozilla Firefox 3.6.19 & Mozilla Firefox 5.0:
>
> XML Parsing Error: not well-formed
> Location:
> http://path/to/git/repo/blah/blah
>
> Both errors were generated by gitweb.perl v1.7.3.4 w/ highlight 2.7
> using arch/ia64/kernel/unwind.c from the Linux kernel.
>
> Strip non-printable control-characters by piping the output produced
> by git-cat-file(1) to col(1) as follows:
>
> git cat-file blob deadbeef314159 | col -bx | highlight <args>
So my only real concern here is that `col` itself is going to munge
whitespace. Quoting from the col man page:
[...] and replaces white-space characters with tabs where
possible. [...]
Have you actually run into a situation where something like ^L was
present in a blob that was being passed to highlight?
- John
next prev parent reply other threads:[~2011-08-16 20:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-16 18:16 [PATCH/RFC] gitweb: highlight: strip non-printable characters via col(1) Christopher M. Fuhrman
2011-08-16 20:30 ` J.H. [this message]
2011-08-16 21:32 ` Christopher M. Fuhrman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E4AD35E.8060907@eaglescrag.net \
--to=warthog9@eaglescrag.net \
--cc=cfuhrman@panix.com \
--cc=cwilson@cdwilson.us \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=sylvain@abstraction.fr \
/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.
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 NNTP newsgroup(s).