From mboxrd@z Thu Jan 1 00:00:00 1970 From: mailings at hupie.com (Ferry Huberts) Date: Tue, 21 Feb 2012 19:41:32 +0100 Subject: [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out In-Reply-To: <20120221142341.GB28585@blizzard> References: <1329826411-6301-1-git-send-email-mailings@hupie.com> <20120221131645.GA12346@blizzard> <4F439FDE.6090107@hupie.com> <20120221142341.GB28585@blizzard> Message-ID: <4F43E55C.309@hupie.com> On 21-02-12 15:23, Lukas Fleischer wrote: > On Tue, Feb 21, 2012 at 02:45:02PM +0100, Ferry Huberts wrote: >> >> >> On 21-02-12 14:16, Lukas Fleischer wrote: >>> On Tue, Feb 21, 2012 at 01:13:29PM +0100, Ferry Huberts wrote: >>>> From: Ferry Huberts >>>> >>>> Saw this happening on a CentOS 6.2 box >>>> >>>> Signed-off-by: Ferry Huberts >>>> --- >>>> 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... >>> >> >> same firefox instance... >> I've tried to trace it but didn't come to a conclusive answer > > Just have a look at the HTML source and check whether it contains the > empty lines. If it doesn't, this is a highlight(1) bug. If it does, it > clearly is a bug in your rendering engine. > ok, narrowed it down: trac appears to be removing empty lines in the html it outputs, have to look further into it. the output of highlight is ok, it has the empty lines. -- Ferry Huberts