Taylor Venable wrote:
Hello,

This seems like a bug to me, but maybe I'm just doing something wrong.
When I try to convert my Lisp or Scheme code into HTML or XHTML (both
with and without CSS) using 2html.vim, I get an error and the only
syntax highlighting in the HTML is the line numbering.  When you look
at the resulting HTML, it still has all the CSS classes in the code,
rather than the font colors that actually represent that code in the
current color scheme.

I'm using Vim 7.0.35 on Xubuntu Linux 2.6.17-10 (using the pre-built
"vim-full" package from the Universe repository).  The output of `vim
--version` is in the attached version.txt file.

Here's the exact error I get:

Error detected while processing /usr/share/vim/vim70/syntax/2html.vim:
line  496:
E486: Pattern not found: <span class="">\([^<]*\)</span>

Turning off the line numbering (:let html_number_lines = 0) makes
everything work just fine.  I tried to do a little debugging on
2html.vim and I find that the script crashes when s:id = 0,
a:style_name = 'lnr' (derived from s:HtmlFormat, line 125).  'lnr'
seems to be for line numbers, which probably explains why it doesn't
crash when I turn off line numbering in the HTML.

I can't tell for sure if this is a bug in 2html or a bug in the Lisp
and Scheme syntax files.  Or maybe I'm just not hitting on the right
options somewhere.  So far, I've only found that it doesn't work for
Scheme and Lisp syntaxes.  Other languages I've tested (Smalltalk, Ada,
OCaml, et al) seem to be alright.

Attached is an example Scheme file (example.scm) and the HTML that
2html generates from it (example.scm.html).  If anybody has any ideas
about this, I'd greatly appreciate it.  Thank you.



With default settings in gvim 7.0.191 running in console mode in /dev/tty
(i.e., a pure-text console, not an xterm), I get no errors. The generated
example.scm.html (attached) displays OK (AFAICT) in Firefox 2, in Konqueror
3.4.0 and (but not with all colours) in Lynx 2.8.5rel.2. All colors are
different (in yours, the background is of a lighter grey and there are no
syntax highlights).

My syntax/2html.vim is dated 2007 Jan 27 and my syntax/scheme.vim is dated Nov
28, 2004 (in the text, not in the directory listing).

You have an outdated version of Vim, and maybe you have an outdated version of
2html.vim too. See http://ftp.vim.org/pub/vim/runtime/7.0/patches/README for
the table of contents of current patches to Vim 7.0. I suggest that you
uninstall the Ubuntu version of Vim then build your own, see
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm

Best regards,
Tony.
--
One day President Reagan, Chairman Andropov, the Pope, and a boy scout
were flying together in an airplane.  Right out in the middle of
nowhere the plane developed engine trouble and started to go down.
Unfortunately, only three parachutes could be found for the four
passengers!  Andropov grabbed one of the parachutes and declared
"Comrades, as leader of the socialist workers revolution, my life must
be spared," and he jumped out of the plane.  Then Reagan exclaimed "As
leader of the greatest nation on earth, I must keep the world safe for
democracy," and with that he too jumped to safety.  Now if you are
following all this (or counting on your fingers) you must see that
there is only one parachute left for the two remaining passengers.  The
Pope looked kindly upon the boy scout and said "I have had a long and
productive life, my son.  You take the parachute and leave me in God's
hands."  "That's very kind of you," the observant scout replied, "but
there is no need.  Reagan just jumped out with my knapsack."

Attachment: example.scm.html.gz
Description: application/gunzip

Reply via email to