[PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out
Lukas Fleischer
cgit at cryptocrack.de
Tue Feb 21 14:16:45 CET 2012
On Tue, Feb 21, 2012 at 01:13:29PM +0100, Ferry Huberts wrote:
> From: Ferry Huberts <ferry.huberts at pelagic.nl>
>
> Saw this happening on a CentOS 6.2 box
>
> Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
> ---
> filters/syntax-highlighting.sh | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
> index 6283ce9..c930e07 100755
> --- a/filters/syntax-highlighting.sh
> +++ b/filters/syntax-highlighting.sh
> @@ -42,4 +42,5 @@ EXTENSION="${BASENAME##*.}"
> # map Makefile and Makefile.* to .mk
> [ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
>
> -exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null
> +# the sed with is a workaround for empty lines getting filtered out
> +exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\ /'
I'm not sure what you're trying to fix here. The whole output of source
filters is always embedded in "pre" containers, so there shouldn't be
any need to replace spaces by " ", really. This rather sounds like
a bug in your rendering engine...
> --
> 1.7.7.6
More information about the CGit
mailing list