La Vita è Bella

Wednesday, December 14, 2005

3 problems in vim's ":TOhtml" feature

":TOhtml" is a great feature in vim. With it, we can generate syntax highlighted html for our code.

Set the following settings will make the generated html code more standard:

let html_use_css = 1
let html_no_pre = 1

But there're still 3 problems:

  1. The "body" tag begins with a "span" tag, which isn't allowed in xhtml. The whole body should be surrounded by a "p" tag.
  2. At the end of every line, there's a "<br>", which should be replaced by "<br />"
  3. Line number was filled with space to be aligned, which should be &nbsp;

Hope the 3 problems will be solved in vim 7.



tags: ,

10:26:06 by fishy - w3c - Permanent Link

Revision: 1.2/1.2, last modified on 2007-01-27 @ 04:24.

Karma: -12 (44.92% out of 118 were positive) [+/-]

You can subscribe to RSS 2.0 feed for comments and trackbacks

Trackbacks:
La Vita è Bella
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,...
2006-05- 9 @ 00:50
Use this TrackBack url to ping this item (right-click, copy link target). If your blog does not support Trackbacks you can manually add your trackback by using this form.

Dirk Gently

Dirk Gently wrote:

Ok, I tried this but like the pre style better. How to I turn in back on.

unlet html_no_pre = 1

doesn't seem to do anything.

Sunday, February 24, 2008 16:23:02

fishy

fishy wrote:

let html_no_pre = 0

or simply delete the 2 lines from your vimrc will work :)

Sunday, February 24, 2008 18:44:44

Dirk Gently

Dirk Gently wrote:

Thanks alot fishy, didnt' work but it led me to this. Turning off pre disables css and it needs to be turned back on:

let html_use_css =1

Monday, February 25, 2008 04:18:10

Add Comment



A blog about open source, patches, thoughts and geeks