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