summaryrefslogtreecommitdiff
path: root/runtime/syntax/2html.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-18 21:55:01 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-18 21:55:01 +0000
commitc1e37901fc8486c9960d7290e521ba51e292e94b (patch)
tree5367e8f83d9d313dd73c0499fd310f57df5e605f /runtime/syntax/2html.vim
parenta93fa7ee7856b54d3778e613c7b7e4b76aaeb2af (diff)
downloadvim-git-c1e37901fc8486c9960d7290e521ba51e292e94b.tar.gz
updated for version 7.0e02v7.0e02
Diffstat (limited to 'runtime/syntax/2html.vim')
-rw-r--r--runtime/syntax/2html.vim36
1 files changed, 27 insertions, 9 deletions
diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim
index 49feceea9..b852f48a9 100644
--- a/runtime/syntax/2html.vim
+++ b/runtime/syntax/2html.vim
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2005 Dec 04
+" Last Change: 2006 Apr 18
" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
@@ -224,14 +224,16 @@ else
endif
let s:HtmlSpace = ' '
+let s:LeadingSpace = ' '
let s:HtmlEndline = ''
if exists("html_no_pre")
let s:HtmlEndline = '<br' . s:tag_close
if exists("use_xhtml")
- let s:HtmlSpace = '\&#x20;'
+ let s:LeadingSpace = '&#x20;'
else
- let s:HtmlSpace = '\&nbsp;'
+ let s:LeadingSpace = '&nbsp;'
endif
+ let s:HtmlSpace = '\' . s:LeadingSpace
endif
" HTML header, with the title and generator ;-). Left free space for the CSS,
@@ -246,9 +248,17 @@ if exists("html_use_css")
exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
endif
if exists("html_no_pre")
- exe "normal! a</head>\n<body>\n\e"
+ if exists("use_xhtml")
+ exe "normal! a</head>\n<body>\n<p>\n\e"
+ else
+ exe "normal! a</head>\n<body>\n\e"
+ endif
else
- exe "normal! a</head>\n<body>\n<pre>\n\e"
+ if exists("use_xhtml")
+ exe "normal! a</head>\n<body>\n<p>\n<pre>\n\e"
+ else
+ exe "normal! a</head>\n<body>\n<pre>\n\e"
+ endif
endif
exe s:orgwin . "wincmd w"
@@ -296,7 +306,7 @@ while s:lnum <= s:end
while s:n > 0
if s:numblines
" Indent if line numbering is on
- let s:new = repeat(' ', strlen(s:end) + 1) . repeat(s:difffillchar, 3)
+ let s:new = repeat(s:LeadingSpace, strlen(s:end) + 1) . repeat(s:difffillchar, 3)
else
let s:new = repeat(s:difffillchar, 3)
endif
@@ -406,9 +416,17 @@ endwhile
" Finish with the last line
exe s:newwin . "wincmd w"
if exists("html_no_pre")
- exe "normal! a\n</body>\n</html>\e"
+ if exists("use_xhtml")
+ exe "normal! a</p>\n</body>\n</html>\e"
+ else
+ exe "normal! a\n</body>\n</html>\e"
+ endif
else
- exe "normal! a</pre>\n</body>\n</html>\e"
+ if exists("use_xhtml")
+ exe "normal! a</pre>\n</p>\n</body>\n</html>\e"
+ else
+ exe "normal! a</pre>\n</body>\n</html>\e"
+ endif
endif
@@ -525,4 +543,4 @@ if !v:profiling
delfunc s:HtmlClosing
endif
endif
-silent! unlet s:diffattr s:difffillchar s:foldfillchar s:HtmlSpace s:HtmlEndline
+silent! unlet s:diffattr s:difffillchar s:foldfillchar s:HtmlSpace s:LeadingSpace s:HtmlEndline