After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706438 - Empty lines added at the beginning and at the end of a programlisting
Empty lines added at the beginning and at the end of a programlisting
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
1.20
Other Linux
: Normal normal
: 1.20
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-20 19:24 UTC by Sébastien Wilmet
Modified: 2013-08-23 07:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The generated GtkdocObject.html, where the bug occurs. (28.09 KB, text/html)
2013-08-21 19:20 UTC, Sébastien Wilmet
  Details
generated test object HTML (25.65 KB, text/html)
2013-08-22 15:18 UTC, Yeti
  Details
FOO.html, output of the fixxref command (1.45 KB, text/html)
2013-08-22 18:53 UTC, Sébastien Wilmet
  Details
patch (1014 bytes, patch)
2013-08-22 19:35 UTC, Yeti
none Details | Review
Fix gtkdoc-fixxref.in with strange 2html.vim version (1.34 KB, patch)
2013-08-22 20:29 UTC, Sébastien Wilmet
committed Details | Review
Fix gtkdoc-fixxref.in with strange 2html.vim version (1.33 KB, patch)
2013-08-23 07:06 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Sébastien Wilmet 2013-08-20 19:24:15 UTC
programlisting's are broken, empty lines are inserted before and after the code.

On developer.gnome.org it seems that the problem doesn't occur. But when generating the doc with --enable-gtk-doc (with glib, gtk+, …), the problem occurs in the outputted html pages.

For example, a programlisting looks like (with the line numbers):

1.
2.
3. the code
4.
5.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-21 18:15:05 UTC
1) Where do you see that?
When I run "make check" in gtk-doc and open "tests/gobject/docs/html/GtkdocObject.html" everything is fine.

2) Which gtk-doc version.
Comment 2 Sébastien Wilmet 2013-08-21 19:20:14 UTC
Created attachment 252653 [details]
The generated GtkdocObject.html, where the bug occurs.
Comment 3 Sébastien Wilmet 2013-08-21 19:21:12 UTC
I use gtk-doc from git, with jhbuild. And it is up-to-date.

$ gtkdoc-mkhtml --version
1.19.1

GtkdocObject.html has the problem here, see the attached file.

Maybe it is a bug in a gtk-doc dependency (docbook?). I use Debian testing.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-22 08:33:31 UTC
I wonder if it is caused by the external syntax highlighter. Which one do you use:
>./config.status --recheck
...
configure: ** Syntax highlighting of examples enabled, using /usr/bin/source-highlight
....
Comment 5 Sébastien Wilmet 2013-08-22 14:18:01 UTC
configure: ** Syntax highlighting of examples enabled, using /usr/bin/vim

source-highlight was not installed on my system. After installing it, source-highlight is used instead of Vim, and this bug is fixed, as well as bug #706439.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-22 14:38:08 UTC
hmm, then the syntax highlighing using vim is borked :/ David, can you take a look?
Comment 7 Yeti 2013-08-22 15:18:28 UTC
Created attachment 252765 [details]
generated test object HTML

I cannot reproduce the problem.  I updated to 5bf7cdca8ff16697f9061c695f02293b6b44488d, ran autogen.sh with --with-highlight=vim, got

configure: ** Syntax highlighting of examples enabled, using /usr/bin/vim

installed the thing, rebuilt the documentation of my libraries with it (it surely used vim because the xref stage was noticeably slower, I also checked the script that it used vim).  But all code listings are fine, no extra empty lines.  I also ran `make check' in gtk-doc and the result is attached.

Tried with vim 7.3.1314 Fedora 19 pacakge.
Comment 8 Sébastien Wilmet 2013-08-22 17:19:57 UTC
I have Vim 7.3.923, from Debian testing. The bug is maybe fixed in a more recent version.
Comment 9 Yeti 2013-08-22 17:52:06 UTC
It's possible but unlikely that it would stop working in a vim revision and be fixed again.  Furthermore, the 2html.vim file bears a comment it has been last changed in 2010.

Try running the command used in fixxref

echo 'let html_number_lines=0|let html_use_css=1|let use_xhtml=1|syn on|e FOO.c|run! syntax/2html.vim|w! FOO.html|qa!' | vim -n -e -u NONE -T xterm >/dev/null

with some C file FOO.  If the output is OK then the problem is in gtk-doc pre-/post-processing.
Comment 10 Sébastien Wilmet 2013-08-22 18:53:20 UTC
Created attachment 252783 [details]
FOO.html, output of the fixxref command

The output seems good.

I also tested with Vim 7.4.0 from Debian unstable.
Comment 11 Yeti 2013-08-22 19:35:30 UTC
Created attachment 252789 [details] [review]
patch

Well, when everything else failed I looked at the actual HTML code of your first attachment...  The problem is not that *empty lines* are inserted.  The problem is that some HTML headers and other crap are not stripped from the vim output as they should be -- because they look differently from what I've ever seen.  And I even checked Debian stable's vim and it produces the expected output.  So I don't know what kind of 2html.vim you have or where you got it but I'm attaching a patch that should get rid of the stuff more aggressively.  I didn't test it because it's difficult to reproduce the strange vim output realistically.  (Sorry, Stefan, no gits were involved in creation of the patch.)
Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-22 20:26:29 UTC
Sébastien, could you try the patch?

David, thanks for the patch, looks good.
Comment 13 Sébastien Wilmet 2013-08-22 20:28:18 UTC
Thanks Yeti, I tried your patch and both bugs are fixed (for the monospace bug too).
Comment 14 Sébastien Wilmet 2013-08-22 20:29:16 UTC
Created attachment 252795 [details] [review]
Fix gtkdoc-fixxref.in with strange 2html.vim version
Comment 15 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-23 07:06:09 UTC
The following fix has been pushed:
ae73c85 Fix gtkdoc-fixxref.in with strange 2html.vim version
Comment 16 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-23 07:06:17 UTC
Created attachment 252811 [details] [review]
Fix gtkdoc-fixxref.in with strange 2html.vim version