annotate runtime/syntax/html.vim @ 9463:78b611afcadb

Added tag v7.4.2012 for changeset 7384c0cfad1375ddf18a8af38160f899574055a5
author Christian Brabandt <cb@256bit.org>
date Sat, 09 Jul 2016 19:30:05 +0200
parents 11d78e58a487
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: HTML
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: http://www.fleiner.com/vim/syntax/html.vim
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
5 " Last Change: 2015 Jan 07
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
6 " included patch from David Felix
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " Please check :help html.vim for some comments and a description of the options
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if !exists("main_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 let main_syntax = 'html'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
21 let s:cpo_save = &cpo
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
22 set cpo&vim
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
23
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " don't use standard HiLink, it will not work with included syntax files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 command! -nargs=+ HtmlHiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 command! -nargs=+ HtmlHiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 829
diff changeset
31 syntax spell toplevel
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " mark illegal characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match htmlError "[<>&]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " tags
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
43 syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
44 syn region htmlTag start=+<[^/]+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match htmlTagError contained "[^>]<"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " tag names
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword htmlTagName contained address applet area a base basefont
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn keyword htmlTagName contained big blockquote br caption center
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword htmlTagName contained cite code dd dfn dir div dl dt font
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn keyword htmlTagName contained form hr html img
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword htmlTagName contained input isindex kbd li link map menu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword htmlTagName contained meta ol option param pre p samp span
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword htmlTagName contained select small strike sub sup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword htmlTagName contained table td textarea th tr tt ul var xmp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 " new html 4.0 tags
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn keyword htmlTagName contained abbr acronym bdo button col label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn keyword htmlTagName contained colgroup del fieldset iframe ins legend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " legal arg names
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword htmlArg contained action
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword htmlArg contained align alink alt archive background bgcolor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn keyword htmlArg contained border bordercolor cellpadding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword htmlArg contained cellspacing checked class clear code codebase color
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn keyword htmlArg contained cols colspan content coords enctype face
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword htmlArg contained gutter height hspace id
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword htmlArg contained link lowsrc marginheight
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn keyword htmlArg contained marginwidth maxlength method name prompt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn keyword htmlArg contained size src start target text type url
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " Netscape extensions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword htmlTagName contained frame noframes frameset nobr blink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn keyword htmlTagName contained layer ilayer nolayer spacer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn keyword htmlArg contained frameborder noresize pagex pagey above below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn keyword htmlArg contained left top visibility clip id noshade
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn match htmlArg contained "\<z-index\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 " Microsoft extensions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn keyword htmlTagName contained marquee
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 " html 4.0 arg names
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match htmlArg contained "\<\(accept-charset\|label\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn keyword htmlArg contained abbr accept accesskey axis char charoff charset
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn keyword htmlArg contained cite classid codetype compact data datetime
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn keyword htmlArg contained declare defer dir disabled for frame
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn keyword htmlArg contained headers hreflang lang language longdesc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn keyword htmlArg contained multiple nohref nowrap object profile readonly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn keyword htmlArg contained rules scheme scope span standby style
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn keyword htmlArg contained summary tabindex valuetype version
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " special characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 " Comments (the real ones or the old netscape ones)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 if exists("html_wrong_comments")
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
105 syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 else
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
107 syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 syn match htmlCommentError contained "[^><!]"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
109 syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 endif
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
111 syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 " server-parsed commands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 syn match htmlPreError contained "<!--#\S*"ms=s+4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 syn match htmlPreProcAttrError contained "\w\+="he=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 if !exists("html_no_rendering")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 " rendering
419
f713fc55bf7b updated for version 7.0109
vimboss
parents: 391
diff changeset
124 syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 syn region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 syn region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 syn region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 syn region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 syn region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 syn region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 syn region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 syn region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlUnderlineItalicBold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 syn region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlUnderlineItalicBold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 syn region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 syn region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 syn region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 syn region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 syn region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 syn region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 syn region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
154 syn match htmlLeadingSpace "^\s\+" contained
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
155 syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 syn region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
163 syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
166 syn keyword htmlTagName contained noscript
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 syn keyword htmlSpecialTagName contained script style
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 if main_syntax != 'java' || exists("java_javascript")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 " JAVA SCRIPT
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
170 syn include @htmlJavaScript syntax/javascript.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 unlet b:current_syntax
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
172 syn region javaScript start=+<script\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
173 syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 HtmlHiLink htmlScriptTag htmlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 " html events (i.e. arguments that include javascript commands)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 if exists("html_extended_events")
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
178 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=htmlEventSQ
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
179 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=htmlEventDQ
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 else
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
181 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=htmlEventSQ
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
182 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=htmlEventDQ
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 endif
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
184 syn region htmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@htmlJavaScript
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
185 syn region htmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@htmlJavaScript
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 HtmlHiLink htmlEventSQ htmlEvent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 HtmlHiLink htmlEventDQ htmlEvent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 " a javascript expression is used as an arg value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 if main_syntax != 'java' || exists("java_vb")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 " VB SCRIPT
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
195 syn include @htmlVbScript syntax/vb.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 unlet b:current_syntax
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
197 syn region javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 syn cluster htmlJavaScript add=@htmlPreproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 if main_syntax != 'java' || exists("java_css")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 " embedded style sheets
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
204 syn keyword htmlArg contained media
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
205 syn include @htmlCss syntax/css.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 syn match htmlCssStyleComment contained "\(<!--\|-->\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 HtmlHiLink htmlStyleArg htmlString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 if main_syntax == "html"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 " synchronizing (does not always work if a comment includes legal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 " html tags, but doing it right would mean to always start
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 " at the first line, which is too slow)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 syn sync match htmlHighlight groupthere NONE "<[/a-zA-Z]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 syn sync match htmlHighlight groupthere javaScript "<script"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 syn sync match htmlHighlightSkip "^.*['\"].*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 syn sync minlines=10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 " The default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 if version >= 508 || !exists("did_html_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 let did_html_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 endif
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
228 HtmlHiLink htmlTag Function
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
229 HtmlHiLink htmlEndTag Identifier
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
230 HtmlHiLink htmlArg Type
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
231 HtmlHiLink htmlTagName htmlStatement
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
232 HtmlHiLink htmlSpecialTagName Exception
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
233 HtmlHiLink htmlValue String
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
234 HtmlHiLink htmlSpecialChar Special
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
235
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 if !exists("html_no_rendering")
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
237 HtmlHiLink htmlH1 Title
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
238 HtmlHiLink htmlH2 htmlH1
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
239 HtmlHiLink htmlH3 htmlH2
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
240 HtmlHiLink htmlH4 htmlH3
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
241 HtmlHiLink htmlH5 htmlH4
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
242 HtmlHiLink htmlH6 htmlH5
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
243 HtmlHiLink htmlHead PreProc
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
244 HtmlHiLink htmlTitle Title
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
245 HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
246 HtmlHiLink htmlUnderlineBold htmlBoldUnderline
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
247 HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
248 HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
249 HtmlHiLink htmlItalicUnderline htmlUnderlineItalic
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
250 HtmlHiLink htmlItalicBold htmlBoldItalic
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
251 HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
252 HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
253 HtmlHiLink htmlLink Underlined
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
254 HtmlHiLink htmlLeadingSpace None
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 if !exists("html_my_rendering")
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
256 hi def htmlBold term=bold cterm=bold gui=bold
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
257 hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
258 hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
260 hi def htmlUnderline term=underline cterm=underline gui=underline
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
262 hi def htmlItalic term=italic cterm=italic gui=italic
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 endif
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
265
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
266 HtmlHiLink htmlPreStmt PreProc
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
267 HtmlHiLink htmlPreError Error
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
268 HtmlHiLink htmlPreProc PreProc
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
269 HtmlHiLink htmlPreAttr String
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 HtmlHiLink htmlPreProcAttrName PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 HtmlHiLink htmlPreProcAttrError Error
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
272 HtmlHiLink htmlSpecial Special
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
273 HtmlHiLink htmlSpecialChar Special
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
274 HtmlHiLink htmlString String
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
275 HtmlHiLink htmlStatement Statement
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
276 HtmlHiLink htmlComment Comment
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
277 HtmlHiLink htmlCommentPart Comment
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
278 HtmlHiLink htmlValue String
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
279 HtmlHiLink htmlCommentError htmlError
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
280 HtmlHiLink htmlTagError htmlError
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
281 HtmlHiLink htmlEvent javaScript
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
282 HtmlHiLink htmlError Error
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
283
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
284 HtmlHiLink javaScript Special
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 HtmlHiLink javaScriptExpression javaScript
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 HtmlHiLink htmlCssStyleComment Comment
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 433
diff changeset
287 HtmlHiLink htmlCssDefinition Special
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 delcommand HtmlHiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 let b:current_syntax = "html"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 if main_syntax == 'html'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
298 let &cpo = s:cpo_save
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
299 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 " vim: ts=8