La Vita è Bella

2006-05-08

vim 7 is out, and a patch for 2html

Updated Again: with this patch, if you let use_xhtml=1, then you must let html_use_css=1, or otherwise the file generated is not a valid xml file. It won't generate a invalid file now.

Finally, vim 7 is released.

I've pointed out 3 bugs in vim's 2html feature, and they were "fixed" in 7.0 -- but not so perfectly.

So I've made a patch for "2html.vim" to resolve my problem.

Please note that, this patch only solved my problem. I haven't tested it on other environments(I mean, different value of "html_use_css", etc.), so use it at your own risk. ;)

download the patch here or see it below:

 1 --- orig/2html.vim      2006-05-08 21:37:46.000000000 +0800
 2 +++ 2html.vim   2006-05-08 21:45:50.000000000 +0800
 3 @@ -229,9 +229,7 @@
 4  let s:HtmlEndline = ''
 5  if exists("html_no_pre")
 6    let s:HtmlEndline = '<br' . s:tag_close
 7 -  if exists("use_xhtml")
 8 -    let s:LeadingSpace = '&#x20;'
 9 -  else
10 +  if !exists("use_xhtml") || exists("use_xhtml") && exists("html_use_css")
11      let s:LeadingSpace = '&nbsp;'
12    endif
13    let s:HtmlSpace = '\' . s:LeadingSpace

Note: It only works perfect with the following settings:

let html_use_css = 1
let html_no_pre = 1
let use_xhtml = 1

15:50:13 by fishy - Permanent Link

May the Force be with you. RAmen