GNOME Bugzilla – Bug 706438
Empty lines added at the beginning and at the end of a programlisting
Last modified: 2013-08-23 07:07:02 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.
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.
Created attachment 252653 [details] The generated GtkdocObject.html, where the bug occurs.
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.
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 ....
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.
hmm, then the syntax highlighing using vim is borked :/ David, can you take a look?
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.
I have Vim 7.3.923, from Debian testing. The bug is maybe fixed in a more recent version.
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.
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.
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.)
Sébastien, could you try the patch? David, thanks for the patch, looks good.
Thanks Yeti, I tried your patch and both bugs are fixed (for the monospace bug too).
Created attachment 252795 [details] [review] Fix gtkdoc-fixxref.in with strange 2html.vim version
The following fix has been pushed: ae73c85 Fix gtkdoc-fixxref.in with strange 2html.vim version
Created attachment 252811 [details] [review] Fix gtkdoc-fixxref.in with strange 2html.vim version