summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/2html.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-12-19 22:46:22 +0000
committerBram Moolenaar <Bram@vim.org>2004-12-19 22:46:22 +0000
commit1cd871b5341bf43ee99e136844e3131014880f92 (patch)
tree6bd9573dbc14de3c4ec85e424cbec9c8d1ee0ed8 /runtime/syntax/2html.vim
parent46c9c73de8def79baf8f0a34a12549f6c14944f3 (diff)
updated for version 7.0023v7.0023
Diffstat (limited to 'runtime/syntax/2html.vim')
-rw-r--r--runtime/syntax/2html.vim24
1 files changed, 18 insertions, 6 deletions
diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim
index 008221400d..2a7a2b133f 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: 2004 Oct 15
+" Last Change: 2004 Dec 14
" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
@@ -211,7 +211,11 @@ let s:old_magic = &magic
set magic
if exists("use_xhtml")
- exe "normal! a<?xml version=\"1.0\"?>\n\e"
+ if s:html_encoding != ""
+ exe "normal! a<?xml version=\"1.0\" encoding=\"" . s:html_encoding . "\"?>\n\e"
+ else
+ exe "normal! a<?xml version=\"1.0\"?>\n\e"
+ endif
let s:tag_close = '/>'
else
let s:tag_close = '>'
@@ -230,8 +234,8 @@ endif
" HTML header, with the title and generator ;-). Left free space for the CSS,
" to be filled at the end.
-exe "normal! a<html>\n<head>\n<title>\e"
-exe "normal! a" . expand("%:p:~") . "</title>\n\e"
+exe "normal! a<html>\n\e"
+exe "normal! a<head>\n<title>" . expand("%:p:~") . "</title>\n\e"
exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . v:version %100 . '"' . s:tag_close . "\n\e"
if s:html_encoding != ""
exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . s:tag_close . "\n\e"
@@ -477,11 +481,19 @@ while s:idlist != ""
endwhile
" Add hyperlinks
-%s+\(http://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|&gt;\|&lt;\|&quot;\)+<A HREF="\1">\1</A>\2+ge
+%s+\(https\=://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|&gt;\|&lt;\|&quot;\)+<a href="\1">\1</a>\2+ge
" The DTD
if exists("html_use_css")
- exe "normal! gg0i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
+ if exists("use_xhtml")
+ exe "normal! gg$a\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\e"
+ else
+ exe "normal! gg0i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
+ endif
+endif
+
+if exists("use_xhtml")
+ exe "normal! gg/<html/e\na xmlns=\"http://www.w3.org/1999/xhtml\"\e"
endif
" Cleanup