Mercurial > vim
annotate runtime/syntax/html.vim @ 33178:1e649fd371cd v9.0.1869
patch 9.0.1869: Coverity warns about unitialized var
Commit: https://github.com/vim/vim/commit/86eda0780590ea8cac49e2aa3bd50245329d3579
Author: Ernie Rael <errael@raelity.com>
Date: Tue Sep 5 07:33:48 2023 +0200
patch 9.0.1869: Coverity warns about unitialized var
Problem: Coverity warns about unitialized var
Solution: initialize it
closes: #13029
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 05 Sep 2023 07:45:04 +0200 |
parents | a9b5ffbc0428 |
children | bc2505818986 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
29450 | 2 " Language: HTML |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Previous Maintainers: Jorge Maldonado Ventura <jorgesumle@freakspot.net> | |
5 " Claudio Fleiner <claudio@fleiner.com> | |
32004 | 6 " Last Change: 2023 Feb 20 |
7 | 7 |
8 " Please check :help html.vim for some comments and a description of the options | |
9 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
10 " quit when a syntax file was already loaded |
7 | 11 if !exists("main_syntax") |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
12 if exists("b:current_syntax") |
7 | 13 finish |
14 endif | |
15 let main_syntax = 'html' | |
16 endif | |
17 | |
3854 | 18 let s:cpo_save = &cpo |
19 set cpo&vim | |
20 | |
1125 | 21 syntax spell toplevel |
7 | 22 |
29450 | 23 syn include @htmlXml syntax/xml.vim |
24 unlet b:current_syntax | |
25 | |
7 | 26 syn case ignore |
27 | |
28 " mark illegal characters | |
29 syn match htmlError "[<>&]" | |
30 | |
31 | |
32 " tags | |
29450 | 33 syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc |
34 syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc | |
35 syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc | |
36 syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError | |
37 syn region htmlTag start=+<[^/]+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster | |
38 syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster | |
39 syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster | |
7 | 40 syn match htmlTagError contained "[^>]<"ms=s+1 |
41 | |
42 | |
43 " tag names | |
44 syn keyword htmlTagName contained address applet area a base basefont | |
45 syn keyword htmlTagName contained big blockquote br caption center | |
46 syn keyword htmlTagName contained cite code dd dfn dir div dl dt font | |
47 syn keyword htmlTagName contained form hr html img | |
48 syn keyword htmlTagName contained input isindex kbd li link map menu | |
49 syn keyword htmlTagName contained meta ol option param pre p samp span | |
29450 | 50 syn keyword htmlTagName contained select small strike sub sup |
7 | 51 syn keyword htmlTagName contained table td textarea th tr tt ul var xmp |
29450 | 52 syn match htmlTagName contained "\<\%(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>" |
7 | 53 |
54 " new html 4.0 tags | |
29450 | 55 syn keyword htmlTagName contained abbr acronym bdo button col colgroup |
56 syn keyword htmlTagName contained del fieldset iframe ins label legend | |
7 | 57 syn keyword htmlTagName contained object optgroup q s tbody tfoot thead |
58 | |
10498
883396809b45
commit https://github.com/vim/vim/commit/bc2eada5424bff06f7eb77c032ecc067da52b846
Christian Brabandt <cb@256bit.org>
parents:
10051
diff
changeset
|
59 " new html 5 tags |
10734 | 60 syn keyword htmlTagName contained article aside audio bdi canvas data |
18972 | 61 syn keyword htmlTagName contained datalist details dialog embed figcaption |
62 syn keyword htmlTagName contained figure footer header hgroup keygen main | |
63 syn keyword htmlTagName contained mark menuitem meter nav output picture | |
10498
883396809b45
commit https://github.com/vim/vim/commit/bc2eada5424bff06f7eb77c032ecc067da52b846
Christian Brabandt <cb@256bit.org>
parents:
10051
diff
changeset
|
64 syn keyword htmlTagName contained progress rb rp rt rtc ruby section |
19721 | 65 syn keyword htmlTagName contained slot source summary template time track |
66 syn keyword htmlTagName contained video wbr | |
10498
883396809b45
commit https://github.com/vim/vim/commit/bc2eada5424bff06f7eb77c032ecc067da52b846
Christian Brabandt <cb@256bit.org>
parents:
10051
diff
changeset
|
67 |
29450 | 68 " svg and math tags |
69 syn keyword htmlMathTagName contained math | |
70 syn keyword htmlSvgTagName contained svg | |
71 | |
72 syn region htmlMath start="<math>" end="</math>" contains=@htmlXml transparent keepend | |
73 syn region htmlSvg start="<svg>" end="</svg>" contains=@htmlXml transparent keepend | |
74 | |
75 syn cluster xmlTagHook add=htmlMathTagName,htmlSvgTagName | |
76 | |
7 | 77 " legal arg names |
78 syn keyword htmlArg contained action | |
79 syn keyword htmlArg contained align alink alt archive background bgcolor | |
80 syn keyword htmlArg contained border bordercolor cellpadding | |
81 syn keyword htmlArg contained cellspacing checked class clear code codebase color | |
82 syn keyword htmlArg contained cols colspan content coords enctype face | |
83 syn keyword htmlArg contained gutter height hspace id | |
84 syn keyword htmlArg contained link lowsrc marginheight | |
85 syn keyword htmlArg contained marginwidth maxlength method name prompt | |
86 syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape | |
87 syn keyword htmlArg contained size src start target text type url | |
88 syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap | |
29450 | 89 syn match htmlArg contained "\<\%(http-equiv\|href\|title\)="me=e-1 |
7 | 90 |
14123 | 91 " aria attributes |
24103 | 92 exe 'syn match htmlArg contained "\<aria-\%(' . join([ |
93 \ 'activedescendant', 'atomic', 'autocomplete', 'busy', 'checked', 'colcount', | |
94 \ 'colindex', 'colspan', 'controls', 'current', 'describedby', 'details', | |
95 \ 'disabled', 'dropeffect', 'errormessage', 'expanded', 'flowto', 'grabbed', | |
96 \ 'haspopup', 'hidden', 'invalid', 'keyshortcuts', 'label', 'labelledby', 'level', | |
97 \ 'live', 'modal', 'multiline', 'multiselectable', 'orientation', 'owns', | |
98 \ 'placeholder', 'posinset', 'pressed', 'readonly', 'relevant', 'required', | |
99 \ 'roledescription', 'rowcount', 'rowindex', 'rowspan', 'selected', 'setsize', | |
100 \ 'sort', 'valuemax', 'valuemin', 'valuenow', 'valuetext' | |
101 \ ], '\|') . '\)\>"' | |
14123 | 102 syn keyword htmlArg contained role |
103 | |
7 | 104 " Netscape extensions |
105 syn keyword htmlTagName contained frame noframes frameset nobr blink | |
106 syn keyword htmlTagName contained layer ilayer nolayer spacer | |
29450 | 107 syn keyword htmlArg contained frameborder noresize pagex pagey above below |
108 syn keyword htmlArg contained left top visibility clip id noshade | |
109 syn match htmlArg contained "\<z-index\>" | |
7 | 110 |
111 " Microsoft extensions | |
112 syn keyword htmlTagName contained marquee | |
113 | |
114 " html 4.0 arg names | |
29450 | 115 syn match htmlArg contained "\<\%(accept-charset\|label\)\>" |
7 | 116 syn keyword htmlArg contained abbr accept accesskey axis char charoff charset |
117 syn keyword htmlArg contained cite classid codetype compact data datetime | |
118 syn keyword htmlArg contained declare defer dir disabled for frame | |
119 syn keyword htmlArg contained headers hreflang lang language longdesc | |
120 syn keyword htmlArg contained multiple nohref nowrap object profile readonly | |
121 syn keyword htmlArg contained rules scheme scope span standby style | |
122 syn keyword htmlArg contained summary tabindex valuetype version | |
123 | |
10548
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10498
diff
changeset
|
124 " html 5 arg names |
29450 | 125 syn keyword htmlArg contained allow autocapitalize as blocking decoding |
126 syn keyword htmlArg contained enterkeyhint imagesizes imagesrcset inert | |
127 syn keyword htmlArg contained integrity is itemid itemprop itemref itemscope | |
128 syn keyword htmlArg contained itemtype loading nomodule ping playsinline | |
129 syn keyword htmlArg contained referrerpolicy slot allowfullscreen async | |
130 syn keyword htmlArg contained autocomplete autofocus autoplay challenge | |
131 syn keyword htmlArg contained contenteditable contextmenu controls crossorigin | |
132 syn keyword htmlArg contained default dirname download draggable dropzone form | |
133 syn keyword htmlArg contained formaction formenctype formmethod formnovalidate | |
134 syn keyword htmlArg contained formtarget hidden high icon inputmode keytype | |
135 syn keyword htmlArg contained kind list loop low max min minlength muted nonce | |
136 syn keyword htmlArg contained novalidate open optimum pattern placeholder | |
137 syn keyword htmlArg contained poster preload radiogroup required reversed | |
138 syn keyword htmlArg contained sandbox spellcheck sizes srcset srcdoc srclang | |
139 syn keyword htmlArg contained step title translate typemustmatch | |
140 syn match htmlArg contained "\<data-\h\%(\w\|[-.]\)*\%(\_s*=\)\@=" | |
10548
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10498
diff
changeset
|
141 |
7 | 142 " special characters |
143 syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" | |
144 | |
145 " Comments (the real ones or the old netscape ones) | |
146 if exists("html_wrong_comments") | |
29450 | 147 syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell |
7 | 148 else |
24103 | 149 " The HTML 5.2 syntax 8.2.4.41: bogus comment is parser error; browser skips until next > |
29450 | 150 syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError keepend |
24103 | 151 " Idem 8.2.4.42,51: Comment starts with <!-- and ends with --> |
152 " Idem 8.2.4.43,44: Except <!--> and <!---> are parser errors | |
153 " Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment | |
29450 | 154 syn region htmlComment matchgroup=htmlComment start=+<!--\%(-\?>\)\@!+ end=+--!\?>+ contains=htmlCommentNested,@htmlPreProc,@Spell keepend |
24103 | 155 " Idem 8.2.4.49: nested comment is parser error, except <!--> is all right |
156 syn match htmlCommentNested contained "<!-->\@!" | |
157 syn match htmlCommentError contained "[^><!]" | |
7 | 158 endif |
29450 | 159 syn region htmlComment start=+<!DOCTYPE+ end=+>+ keepend |
7 | 160 |
161 " server-parsed commands | |
162 syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr | |
29450 | 163 syn match htmlPreStmt contained "<!--#\%(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>" |
7 | 164 syn match htmlPreError contained "<!--#\S*"ms=s+4 |
165 syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName | |
166 syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend | |
167 syn match htmlPreProcAttrError contained "\w\+="he=e-1 | |
29450 | 168 syn match htmlPreProcAttrName contained "\%(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1 |
7 | 169 |
170 if !exists("html_no_rendering") | |
171 " rendering | |
419 | 172 syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc |
7 | 173 |
16267 | 174 syn region htmlStrike start="<del\>" end="</del\_s*>"me=s-1 contains=@htmlTop |
29450 | 175 syn region htmlStrike start="<s\>" end="</s\_s*>"me=s-1 contains=@htmlTop |
16267 | 176 syn region htmlStrike start="<strike\>" end="</strike\_s*>"me=s-1 contains=@htmlTop |
12756
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
10734
diff
changeset
|
177 |
16267 | 178 syn region htmlBold start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic |
179 syn region htmlBold start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic | |
180 syn region htmlBoldUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderlineItalic | |
181 syn region htmlBoldItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop,htmlBoldItalicUnderline | |
182 syn region htmlBoldItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop,htmlBoldItalicUnderline | |
183 syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop | |
184 syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop | |
185 syn region htmlBoldItalicUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderlineItalic | |
7 | 186 |
16267 | 187 syn region htmlUnderline start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic |
188 syn region htmlUnderlineBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineBoldItalic | |
189 syn region htmlUnderlineBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineBoldItalic | |
190 syn region htmlUnderlineItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineItalicBold | |
191 syn region htmlUnderlineItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineItalicBold | |
192 syn region htmlUnderlineItalicBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop | |
193 syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop | |
194 syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop | |
195 syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop | |
7 | 196 |
16267 | 197 syn region htmlItalic start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline |
198 syn region htmlItalic start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop | |
199 syn region htmlItalicBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop,htmlItalicBoldUnderline | |
200 syn region htmlItalicBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop,htmlItalicBoldUnderline | |
201 syn region htmlItalicBoldUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop | |
202 syn region htmlItalicUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop,htmlItalicUnderlineBold | |
203 syn region htmlItalicUnderlineBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop | |
204 syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop | |
7 | 205 |
3854 | 206 syn match htmlLeadingSpace "^\s\+" contained |
16267 | 207 syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a\_s*>"me=s-1 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc |
208 syn region htmlH1 start="<h1\>" end="</h1\_s*>"me=s-1 contains=@htmlTop | |
209 syn region htmlH2 start="<h2\>" end="</h2\_s*>"me=s-1 contains=@htmlTop | |
210 syn region htmlH3 start="<h3\>" end="</h3\_s*>"me=s-1 contains=@htmlTop | |
211 syn region htmlH4 start="<h4\>" end="</h4\_s*>"me=s-1 contains=@htmlTop | |
212 syn region htmlH5 start="<h5\>" end="</h5\_s*>"me=s-1 contains=@htmlTop | |
213 syn region htmlH6 start="<h6\>" end="</h6\_s*>"me=s-1 contains=@htmlTop | |
214 syn region htmlHead start="<head\>" end="</head\_s*>"me=s-1 end="<body\>"me=s-1 end="<h[1-6]\>"me=s-1 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc | |
215 syn region htmlTitle start="<title\>" end="</title\_s*>"me=s-1 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc | |
7 | 216 endif |
217 | |
29450 | 218 syn keyword htmlTagName contained noscript |
219 syn keyword htmlSpecialTagName contained script style | |
7 | 220 if main_syntax != 'java' || exists("java_javascript") |
221 " JAVA SCRIPT | |
829 | 222 syn include @htmlJavaScript syntax/javascript.vim |
7 | 223 unlet b:current_syntax |
32004 | 224 syn region javaScript start=+<script\>\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc |
29450 | 225 syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
226 hi def link htmlScriptTag htmlTag |
7 | 227 |
228 " html events (i.e. arguments that include javascript commands) | |
229 if exists("html_extended_events") | |
29450 | 230 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=htmlEventSQ |
231 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=htmlEventDQ | |
7 | 232 else |
29450 | 233 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=htmlEventSQ |
234 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=htmlEventDQ | |
7 | 235 endif |
29450 | 236 syn region htmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@htmlJavaScript |
237 syn region htmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@htmlJavaScript | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
238 hi def link htmlEventSQ htmlEvent |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
239 hi def link htmlEventDQ htmlEvent |
7 | 240 |
241 " a javascript expression is used as an arg value | |
242 syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc | |
243 endif | |
244 | |
245 if main_syntax != 'java' || exists("java_vb") | |
246 " VB SCRIPT | |
829 | 247 syn include @htmlVbScript syntax/vb.vim |
7 | 248 unlet b:current_syntax |
6476 | 249 syn region javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc |
7 | 250 endif |
251 | |
29450 | 252 syn cluster htmlJavaScript add=@htmlPreproc |
7 | 253 |
254 if main_syntax != 'java' || exists("java_css") | |
255 " embedded style sheets | |
29450 | 256 syn keyword htmlArg contained media |
829 | 257 syn include @htmlCss syntax/css.vim |
7 | 258 unlet b:current_syntax |
259 syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc | |
29450 | 260 syn match htmlCssStyleComment contained "\%(<!--\|-->\)" |
7 | 261 syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
262 hi def link htmlStyleArg htmlString |
7 | 263 endif |
264 | |
265 if main_syntax == "html" | |
266 " synchronizing (does not always work if a comment includes legal | |
267 " html tags, but doing it right would mean to always start | |
268 " at the first line, which is too slow) | |
269 syn sync match htmlHighlight groupthere NONE "<[/a-zA-Z]" | |
270 syn sync match htmlHighlight groupthere javaScript "<script" | |
271 syn sync match htmlHighlightSkip "^.*['\"].*$" | |
272 syn sync minlines=10 | |
273 endif | |
274 | |
31139 | 275 " Folding |
276 " Originally by Ingo Karkat and Marcus Zanona | |
277 if get(g:, "html_syntax_folding", 0) | |
278 syn region htmlFold start="<\z(\<\%(area\|base\|br\|col\|command\|embed\|hr\|img\|input\|keygen\|link\|meta\|param\|source\|track\|wbr\>\)\@![a-z-]\+\>\)\%(\_s*\_[^/]\?>\|\_s\_[^>]*\_[^>/]>\)" end="</\z1\_s*>" fold transparent keepend extend containedin=htmlHead,htmlH\d | |
279 " fold comments (the real ones and the old Netscape ones) | |
280 if exists("html_wrong_comments") | |
281 syn region htmlComment start=+<!--+ end=+--\s*>\%(\n\s*<!--\)\@!+ contains=@Spell fold | |
282 endif | |
283 endif | |
284 | |
7 | 285 " The default highlighting. |
29450 | 286 hi def link htmlTag Function |
287 hi def link htmlEndTag Identifier | |
288 hi def link htmlArg Type | |
289 hi def link htmlTagName htmlStatement | |
290 hi def link htmlSpecialTagName Exception | |
291 hi def link htmlMathTagName htmlTagName | |
292 hi def link htmlSvgTagName htmlTagName | |
293 hi def link htmlValue String | |
294 hi def link htmlSpecialChar Special | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
295 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
296 if !exists("html_no_rendering") |
29450 | 297 hi def link htmlH1 Title |
298 hi def link htmlH2 htmlH1 | |
299 hi def link htmlH3 htmlH2 | |
300 hi def link htmlH4 htmlH3 | |
301 hi def link htmlH5 htmlH4 | |
302 hi def link htmlH6 htmlH5 | |
303 hi def link htmlHead PreProc | |
304 hi def link htmlTitle Title | |
305 hi def link htmlBoldItalicUnderline htmlBoldUnderlineItalic | |
306 hi def link htmlUnderlineBold htmlBoldUnderline | |
307 hi def link htmlUnderlineItalicBold htmlBoldUnderlineItalic | |
308 hi def link htmlUnderlineBoldItalic htmlBoldUnderlineItalic | |
309 hi def link htmlItalicUnderline htmlUnderlineItalic | |
310 hi def link htmlItalicBold htmlBoldItalic | |
311 hi def link htmlItalicBoldUnderline htmlBoldUnderlineItalic | |
312 hi def link htmlItalicUnderlineBold htmlBoldUnderlineItalic | |
313 hi def link htmlLink Underlined | |
314 hi def link htmlLeadingSpace None | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
315 if !exists("html_my_rendering") |
29450 | 316 hi def htmlBold term=bold cterm=bold gui=bold |
317 hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline | |
318 hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
319 hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline |
29450 | 320 hi def htmlUnderline term=underline cterm=underline gui=underline |
321 hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline | |
322 hi def htmlItalic term=italic cterm=italic gui=italic | |
12756
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
10734
diff
changeset
|
323 if v:version > 800 || v:version == 800 && has("patch1038") |
29450 | 324 hi def htmlStrike term=strikethrough cterm=strikethrough gui=strikethrough |
12756
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
10734
diff
changeset
|
325 else |
29450 | 326 hi def htmlStrike term=underline cterm=underline gui=underline |
12756
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
10734
diff
changeset
|
327 endif |
7 | 328 endif |
329 endif | |
330 | |
29450 | 331 hi def link htmlPreStmt PreProc |
332 hi def link htmlPreError Error | |
333 hi def link htmlPreProc PreProc | |
334 hi def link htmlPreAttr String | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
335 hi def link htmlPreProcAttrName PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
336 hi def link htmlPreProcAttrError Error |
29450 | 337 hi def link htmlString String |
338 hi def link htmlStatement Statement | |
339 hi def link htmlComment Comment | |
340 hi def link htmlCommentNested htmlError | |
341 hi def link htmlCommentError htmlError | |
342 hi def link htmlTagError htmlError | |
343 hi def link htmlEvent javaScript | |
344 hi def link htmlError Error | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
345 |
29450 | 346 hi def link javaScript Special |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
347 hi def link javaScriptExpression javaScript |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
348 hi def link htmlCssStyleComment Comment |
29450 | 349 hi def link htmlCssDefinition Special |
7 | 350 |
351 let b:current_syntax = "html" | |
352 | |
353 if main_syntax == 'html' | |
354 unlet main_syntax | |
355 endif | |
356 | |
3854 | 357 let &cpo = s:cpo_save |
358 unlet s:cpo_save | |
7 | 359 " vim: ts=8 |