List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out
@ 2012-02-21 12:13 mailings
  2012-02-21 12:13 ` [PATCH v2 2/3] highlight: declare variables mailings
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: mailings @ 2012-02-21 12:13 UTC (permalink / raw)


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 &nbsp; is a workaround for empty lines getting filtered out
+exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
-- 
1.7.7.6





^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 2/3] highlight: declare variables
  2012-02-21 12:13 [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out mailings
@ 2012-02-21 12:13 ` mailings
  2012-02-21 13:23   ` cgit
  2012-02-21 12:13 ` [PATCH v2 3/3] highlight: fix syntax highlighting for program versions > 2 mailings
  2012-02-21 13:16 ` [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out cgit
  2 siblings, 1 reply; 12+ messages in thread
From: mailings @ 2012-02-21 12:13 UTC (permalink / raw)


From: Ferry Huberts <ferry.huberts at pelagic.nl>

Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
 filters/syntax-highlighting.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
index c930e07..0f97fea 100755
--- a/filters/syntax-highlighting.sh
+++ b/filters/syntax-highlighting.sh
@@ -36,8 +36,8 @@
 #
 
 # store filename and extension in local vars
-BASENAME="$1"
-EXTENSION="${BASENAME##*.}"
+declare BASENAME="$1"
+declare EXTENSION="${BASENAME##*.}"
 
 # map Makefile and Makefile.* to .mk
 [ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
-- 
1.7.7.6





^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 3/3] highlight: fix syntax highlighting for program versions > 2
  2012-02-21 12:13 [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out mailings
  2012-02-21 12:13 ` [PATCH v2 2/3] highlight: declare variables mailings
@ 2012-02-21 12:13 ` mailings
  2012-02-21 13:27   ` cgit
  2012-02-21 13:16 ` [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out cgit
  2 siblings, 1 reply; 12+ messages in thread
From: mailings @ 2012-02-21 12:13 UTC (permalink / raw)


From: Ferry Huberts <ferry.huberts at pelagic.nl>

Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
 filters/syntax-highlighting.sh |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
index 0f97fea..387960d 100755
--- a/filters/syntax-highlighting.sh
+++ b/filters/syntax-highlighting.sh
@@ -42,5 +42,23 @@ declare EXTENSION="${BASENAME##*.}"
 # map Makefile and Makefile.* to .mk
 [ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
 
-# the sed with &nbsp; is a workaround for empty lines getting filtered out
-exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
+# get highlight version
+declare regex='^[[:space:]]*highlight[[:space:]]+version[[:space:]]+([[:digit:]]+).*'
+declare -i highlightVersion=$(highlight --version | grep -E "${regex}" | sed -r "s/${regex}/\1/")
+
+if [[ ${highlightVersion} -le 2 ]]; then
+  # for highlight  <= 2.x
+
+  # the sed with &nbsp; is a workaround for empty lines getting filtered out
+  exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
+else
+  # for other highlight versions
+
+  # workaround for --force bug:
+  # set to plain text when highlight doesn't know the format
+  echo "test" | highlight -f -I -O xhtml -S $EXTENSION &>/dev/null
+  [ ${?} -ne 0 ] && EXTENSION="txt"
+
+  # the sed with &nbsp; is a workaround for empty lines getting filtered out
+  exec highlight -f -I -O xhtml -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
+fi
-- 
1.7.7.6





^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out
  2012-02-21 12:13 [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out mailings
  2012-02-21 12:13 ` [PATCH v2 2/3] highlight: declare variables mailings
  2012-02-21 12:13 ` [PATCH v2 3/3] highlight: fix syntax highlighting for program versions > 2 mailings
@ 2012-02-21 13:16 ` cgit
  2012-02-21 13:45   ` mailings
  2 siblings, 1 reply; 12+ messages in thread
From: cgit @ 2012-02-21 13:16 UTC (permalink / raw)


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 &nbsp; is a workaround for empty lines getting filtered out
> +exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'

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 "&nbsp;", really. This rather sounds like
a bug in your rendering engine...

> -- 
> 1.7.7.6




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 2/3] highlight: declare variables
  2012-02-21 12:13 ` [PATCH v2 2/3] highlight: declare variables mailings
@ 2012-02-21 13:23   ` cgit
  0 siblings, 0 replies; 12+ messages in thread
From: cgit @ 2012-02-21 13:23 UTC (permalink / raw)


On Tue, Feb 21, 2012 at 01:13:30PM +0100, Ferry Huberts wrote:
> From: Ferry Huberts <ferry.huberts at pelagic.nl>
> 
> Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
> ---
>  filters/syntax-highlighting.sh |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
> index c930e07..0f97fea 100755
> --- a/filters/syntax-highlighting.sh
> +++ b/filters/syntax-highlighting.sh
> @@ -36,8 +36,8 @@
>  #
>  
>  # store filename and extension in local vars
> -BASENAME="$1"
> -EXTENSION="${BASENAME##*.}"
> +declare BASENAME="$1"
> +declare EXTENSION="${BASENAME##*.}"

"declare" isn't POSIX'ish and we shouldn't rely on bashishms unless Lars
agrees and we change the shebang to "#!/bin/bash".

>  
>  # map Makefile and Makefile.* to .mk
>  [ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
> -- 
> 1.7.7.6




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 3/3] highlight: fix syntax highlighting for program versions > 2
  2012-02-21 12:13 ` [PATCH v2 3/3] highlight: fix syntax highlighting for program versions > 2 mailings
@ 2012-02-21 13:27   ` cgit
  2012-02-21 13:47     ` mailings
  0 siblings, 1 reply; 12+ messages in thread
From: cgit @ 2012-02-21 13:27 UTC (permalink / raw)


On Tue, Feb 21, 2012 at 01:13:31PM +0100, Ferry Huberts wrote:
> From: Ferry Huberts <ferry.huberts at pelagic.nl>
> 
> Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
> ---
>  filters/syntax-highlighting.sh |   22 ++++++++++++++++++++--
>  1 files changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
> index 0f97fea..387960d 100755
> --- a/filters/syntax-highlighting.sh
> +++ b/filters/syntax-highlighting.sh
> @@ -42,5 +42,23 @@ declare EXTENSION="${BASENAME##*.}"
>  # map Makefile and Makefile.* to .mk
>  [ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
>  
> -# the sed with &nbsp; is a workaround for empty lines getting filtered out
> -exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
> +# get highlight version
> +declare regex='^[[:space:]]*highlight[[:space:]]+version[[:space:]]+([[:digit:]]+).*'
> +declare -i highlightVersion=$(highlight --version | grep -E "${regex}" | sed -r "s/${regex}/\1/")
> +
> +if [[ ${highlightVersion} -le 2 ]]; then
> +  # for highlight  <= 2.x
> +
> +  # the sed with &nbsp; is a workaround for empty lines getting filtered out
> +  exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
> +else
> +  # for other highlight versions
> +
> +  # workaround for --force bug:
> +  # set to plain text when highlight doesn't know the format
> +  echo "test" | highlight -f -I -O xhtml -S $EXTENSION &>/dev/null
> +  [ ${?} -ne 0 ] && EXTENSION="txt"
> +
> +  # the sed with &nbsp; is a workaround for empty lines getting filtered out
> +  exec highlight -f -I -O xhtml -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
> +fi

Good to know that this is broken, but your solution seems like a hack
without any explanation... Could you elaborate why this is needed and
why this is the proper way to fix this regression, please?

> -- 
> 1.7.7.6




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out
  2012-02-21 13:16 ` [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out cgit
@ 2012-02-21 13:45   ` mailings
  2012-02-21 14:23     ` cgit
  0 siblings, 1 reply; 12+ messages in thread
From: mailings @ 2012-02-21 13:45 UTC (permalink / raw)




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<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&nbsp; is a workaround for empty lines getting filtered out
>> +exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
>
> 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 "&nbsp;", 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


-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 3/3] highlight: fix syntax highlighting for program versions > 2
  2012-02-21 13:27   ` cgit
@ 2012-02-21 13:47     ` mailings
  2012-02-21 14:21       ` cgit
  0 siblings, 1 reply; 12+ messages in thread
From: mailings @ 2012-02-21 13:47 UTC (permalink / raw)




On 21-02-12 14:27, Lukas Fleischer wrote:
> On Tue, Feb 21, 2012 at 01:13:31PM +0100, Ferry Huberts wrote:
>> From: Ferry Huberts<ferry.huberts at pelagic.nl>
>>
>> Signed-off-by: Ferry Huberts<ferry.huberts at pelagic.nl>
>> ---
>>   filters/syntax-highlighting.sh |   22 ++++++++++++++++++++--
>>   1 files changed, 20 insertions(+), 2 deletions(-)
>>
>> diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
>> index 0f97fea..387960d 100755
>> --- a/filters/syntax-highlighting.sh
>> +++ b/filters/syntax-highlighting.sh
>> @@ -42,5 +42,23 @@ declare EXTENSION="${BASENAME##*.}"
>>   # map Makefile and Makefile.* to .mk
>>   [ "${BASENAME%%.*}" == "Makefile" ]&&  EXTENSION=mk
>>
>> -# the sed with&nbsp; is a workaround for empty lines getting filtered out
>> -exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
>> +# get highlight version
>> +declare regex='^[[:space:]]*highlight[[:space:]]+version[[:space:]]+([[:digit:]]+).*'
>> +declare -i highlightVersion=$(highlight --version | grep -E "${regex}" | sed -r "s/${regex}/\1/")
>> +
>> +if [[ ${highlightVersion} -le 2 ]]; then
>> +  # for highlight<= 2.x
>> +
>> +  # the sed with&nbsp; is a workaround for empty lines getting filtered out
>> +  exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
>> +else
>> +  # for other highlight versions
>> +
>> +  # workaround for --force bug:
>> +  # set to plain text when highlight doesn't know the format
>> +  echo "test" | highlight -f -I -O xhtml -S $EXTENSION&>/dev/null
>> +  [ ${?} -ne 0 ]&&  EXTENSION="txt"
>> +
>> +  # the sed with&nbsp; is a workaround for empty lines getting filtered out
>> +  exec highlight -f -I -O xhtml -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
>> +fi
>
> Good to know that this is broken, but your solution seems like a hack
> without any explanation... Could you elaborate why this is needed and
> why this is the proper way to fix this regression, please?
>

ok, thought it was clear.

On CentOS 6.2 (use highlight from EPEL), when highlight doesn't know 
about an EXTENSION, it outputs a lua error and _no_ text, even when the 
--force option is used.


see https://bugzilla.redhat.com/show_bug.cgi?id=795567

-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 3/3] highlight: fix syntax highlighting for program versions > 2
  2012-02-21 13:47     ` mailings
@ 2012-02-21 14:21       ` cgit
  0 siblings, 0 replies; 12+ messages in thread
From: cgit @ 2012-02-21 14:21 UTC (permalink / raw)


On Tue, Feb 21, 2012 at 02:47:51PM +0100, Ferry Huberts wrote:
> 
> 
> On 21-02-12 14:27, Lukas Fleischer wrote:
> >On Tue, Feb 21, 2012 at 01:13:31PM +0100, Ferry Huberts wrote:
> >>From: Ferry Huberts<ferry.huberts at pelagic.nl>
> >>
> >>Signed-off-by: Ferry Huberts<ferry.huberts at pelagic.nl>
> >>---
> >>  filters/syntax-highlighting.sh |   22 ++++++++++++++++++++--
> >>  1 files changed, 20 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
> >>index 0f97fea..387960d 100755
> >>--- a/filters/syntax-highlighting.sh
> >>+++ b/filters/syntax-highlighting.sh
> >>@@ -42,5 +42,23 @@ declare EXTENSION="${BASENAME##*.}"
> >>  # map Makefile and Makefile.* to .mk
> >>  [ "${BASENAME%%.*}" == "Makefile" ]&&  EXTENSION=mk
> >>
> >>-# the sed with&nbsp; is a workaround for empty lines getting filtered out
> >>-exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
> >>+# get highlight version
> >>+declare regex='^[[:space:]]*highlight[[:space:]]+version[[:space:]]+([[:digit:]]+).*'
> >>+declare -i highlightVersion=$(highlight --version | grep -E "${regex}" | sed -r "s/${regex}/\1/")
> >>+
> >>+if [[ ${highlightVersion} -le 2 ]]; then
> >>+  # for highlight<= 2.x
> >>+
> >>+  # the sed with&nbsp; is a workaround for empty lines getting filtered out
> >>+  exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
> >>+else
> >>+  # for other highlight versions
> >>+
> >>+  # workaround for --force bug:
> >>+  # set to plain text when highlight doesn't know the format
> >>+  echo "test" | highlight -f -I -O xhtml -S $EXTENSION&>/dev/null
> >>+  [ ${?} -ne 0 ]&&  EXTENSION="txt"
> >>+
> >>+  # the sed with&nbsp; is a workaround for empty lines getting filtered out
> >>+  exec highlight -f -I -O xhtml -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
> >>+fi
> >
> >Good to know that this is broken, but your solution seems like a hack
> >without any explanation... Could you elaborate why this is needed and
> >why this is the proper way to fix this regression, please?
> >
> 
> ok, thought it was clear.
> 
> On CentOS 6.2 (use highlight from EPEL), when highlight doesn't know
> about an EXTENSION, it outputs a lua error and _no_ text, even when
> the --force option is used.

Ok, so this is something that can be reverted as soon as the bug in
highlight(1) is fixed. It probably makes sense to mention this in the
commit message :)

You should also try to report this bug upstream (unless you did already)
and add a link to the Red Hat bug report, since this is unlikely to be a
packaging bug...

> 
> 
> see https://bugzilla.redhat.com/show_bug.cgi?id=795567
> 
> -- 
> Ferry Huberts




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out
  2012-02-21 13:45   ` mailings
@ 2012-02-21 14:23     ` cgit
  2012-02-21 15:21       ` mailings
  2012-02-21 18:41       ` mailings
  0 siblings, 2 replies; 12+ messages in thread
From: cgit @ 2012-02-21 14:23 UTC (permalink / raw)


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<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&nbsp; is a workaround for empty lines getting filtered out
> >>+exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
> >
> >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 "&nbsp;", 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.

> 
> 
> -- 
> Ferry Huberts




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out
  2012-02-21 14:23     ` cgit
@ 2012-02-21 15:21       ` mailings
  2012-02-21 18:41       ` mailings
  1 sibling, 0 replies; 12+ messages in thread
From: mailings @ 2012-02-21 15:21 UTC (permalink / raw)




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<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&nbsp; is a workaround for empty lines getting filtered out
>>>> +exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
>>>
>>> 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 "&nbsp;", 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.
>
>>

well.. yes and no

I embedded cgit in trac, and the output/source looks ok for both situations:
1- CentOS 5, cgit, trac 0.10
2- CentOS 6, cgit, trac 0.12

in the _same_ Firefox instance.

I'm suspecting some weird css stuff removing empty lines. Don't know if 
that is possible at all, don't know very much about css

-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out
  2012-02-21 14:23     ` cgit
  2012-02-21 15:21       ` mailings
@ 2012-02-21 18:41       ` mailings
  1 sibling, 0 replies; 12+ messages in thread
From: mailings @ 2012-02-21 18:41 UTC (permalink / raw)




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<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&nbsp; is a workaround for empty lines getting filtered out
>>>> +exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null | sed -r 's/^[[:space:]]*$/\&nbsp;/'
>>>
>>> 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 "&nbsp;", 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




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-02-21 18:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-21 12:13 [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out mailings
2012-02-21 12:13 ` [PATCH v2 2/3] highlight: declare variables mailings
2012-02-21 13:23   ` cgit
2012-02-21 12:13 ` [PATCH v2 3/3] highlight: fix syntax highlighting for program versions > 2 mailings
2012-02-21 13:27   ` cgit
2012-02-21 13:47     ` mailings
2012-02-21 14:21       ` cgit
2012-02-21 13:16 ` [PATCH v2 1/3] highlight: add workaround for empty lines getting filtered out cgit
2012-02-21 13:45   ` mailings
2012-02-21 14:23     ` cgit
2012-02-21 15:21       ` mailings
2012-02-21 18:41       ` mailings

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).