Mercurial > vim
comparison runtime/syntax/html.vim @ 24103:788e10cec9bd
Update runtime files.
Commit: https://github.com/vim/vim/commit/c8cdf0f80b3cfd88a4490d80572062c1fd1a96ca
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 13 13:28:13 2021 +0100
Update runtime files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 13 Mar 2021 13:30:04 +0100 |
parents | ef454a7f485d |
children | 67f31c24291b |
comparison
equal
deleted
inserted
replaced
24102:f897c1862d9e | 24103:788e10cec9bd |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: HTML | 2 " Language: HTML |
3 " Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net> | 3 " Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net> |
4 " Previous Maintainer: Claudio Fleiner <claudio@fleiner.com> | 4 " Previous Maintainer: Claudio Fleiner <claudio@fleiner.com> |
5 " Repository: https://notabug.org/jorgesumle/vim-html-syntax | 5 " Repository: https://notabug.org/jorgesumle/vim-html-syntax |
6 " Last Change: 2021 Feb 25 | 6 " Last Change: 2021 Mar 02 |
7 " Included patch #7900 to fix comments | 7 " Included patch #7900 to fix comments |
8 " Included patch #7916 to fix a few more things | |
8 " | 9 " |
9 | 10 |
10 " Please check :help html.vim for some comments and a description of the options | 11 " Please check :help html.vim for some comments and a description of the options |
11 | 12 |
12 " quit when a syntax file was already loaded | 13 " quit when a syntax file was already loaded |
77 syn keyword htmlArg contained size src start target text type url | 78 syn keyword htmlArg contained size src start target text type url |
78 syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap | 79 syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap |
79 syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1 | 80 syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1 |
80 | 81 |
81 " aria attributes | 82 " aria attributes |
82 syn match htmlArg contained "\<\(aria-activedescendant\|aria-atomic\)\>" | 83 exe 'syn match htmlArg contained "\<aria-\%(' . join([ |
83 syn match htmlArg contained "\<\(aria-autocomplete\|aria-busy\|aria-checked\)\>" | 84 \ 'activedescendant', 'atomic', 'autocomplete', 'busy', 'checked', 'colcount', |
84 syn match htmlArg contained "\<\(aria-colcount\|aria-colindex\|aria-colspan\)\>" | 85 \ 'colindex', 'colspan', 'controls', 'current', 'describedby', 'details', |
85 syn match htmlArg contained "\<\(aria-controls\|aria-current\)\>" | 86 \ 'disabled', 'dropeffect', 'errormessage', 'expanded', 'flowto', 'grabbed', |
86 syn match htmlArg contained "\<\(aria-describedby\|aria-details\)\>" | 87 \ 'haspopup', 'hidden', 'invalid', 'keyshortcuts', 'label', 'labelledby', 'level', |
87 syn match htmlArg contained "\<\(aria-disabled\|aria-dropeffect\)\>" | 88 \ 'live', 'modal', 'multiline', 'multiselectable', 'orientation', 'owns', |
88 syn match htmlArg contained "\<\(aria-errormessage\|aria-expanded\)\>" | 89 \ 'placeholder', 'posinset', 'pressed', 'readonly', 'relevant', 'required', |
89 syn match htmlArg contained "\<\(aria-flowto\|aria-grabbed\|aria-haspopup\)\>" | 90 \ 'roledescription', 'rowcount', 'rowindex', 'rowspan', 'selected', 'setsize', |
90 syn match htmlArg contained "\<\(aria-hidden\|aria-invalid\)\>" | 91 \ 'sort', 'valuemax', 'valuemin', 'valuenow', 'valuetext' |
91 syn match htmlArg contained "\<\(aria-keyshortcuts\|aria-label\)\>" | 92 \ ], '\|') . '\)\>"' |
92 syn match htmlArg contained "\<\(aria-labelledby\|aria-level\|aria-live\)\>" | |
93 syn match htmlArg contained "\<\(aria-modal\|aria-multiline\)\>" | |
94 syn match htmlArg contained "\<\(aria-multiselectable\|aria-orientation\)\>" | |
95 syn match htmlArg contained "\<\(aria-owns\|aria-placeholder\|aria-posinset\)\>" | |
96 syn match htmlArg contained "\<\(aria-pressed\|aria-readonly\|aria-relevant\)\>" | |
97 syn match htmlArg contained "\<\(aria-required\|aria-roledescription\)\>" | |
98 syn match htmlArg contained "\<\(aria-rowcount\|aria-rowindex\|aria-rowspan\)\>" | |
99 syn match htmlArg contained "\<\(aria-selected\|aria-setsize\|aria-sort\)\>" | |
100 syn match htmlArg contained "\<\(aria-valuemax\|aria-valuemin\)\>" | |
101 syn match htmlArg contained "\<\(aria-valuenow\|aria-valuetext\)\>" | |
102 syn keyword htmlArg contained role | 93 syn keyword htmlArg contained role |
103 | 94 |
104 " Netscape extensions | 95 " Netscape extensions |
105 syn keyword htmlTagName contained frame noframes frameset nobr blink | 96 syn keyword htmlTagName contained frame noframes frameset nobr blink |
106 syn keyword htmlTagName contained layer ilayer nolayer spacer | 97 syn keyword htmlTagName contained layer ilayer nolayer spacer |
137 " special characters | 128 " special characters |
138 syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" | 129 syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" |
139 | 130 |
140 " Comments (the real ones or the old netscape ones) | 131 " Comments (the real ones or the old netscape ones) |
141 if exists("html_wrong_comments") | 132 if exists("html_wrong_comments") |
142 syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell | 133 syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell |
143 else | 134 else |
144 " The HTML 5.2 syntax 8.2.4.41-42: bogus comment is parser error; browser skips until next > | 135 " The HTML 5.2 syntax 8.2.4.41: bogus comment is parser error; browser skips until next > |
145 " Note: must stand first to get lesser :syn-priority | 136 syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError keepend |
146 syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError | 137 " Idem 8.2.4.42,51: Comment starts with <!-- and ends with --> |
147 " Normal comment opening <!-- ...> | 138 " Idem 8.2.4.43,44: Except <!--> and <!---> are parser errors |
148 syn region htmlComment start=+<!--+ end=+>+ contains=htmlCommentPart,@Spell | 139 " Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment |
149 " Idem 8.2.4.43-44: <!--> and <!---> are parser errors; browser treats as comments | 140 syn region htmlComment matchgroup=htmlComment start=+<!--\%(-\?>\)\@!+ end=+--!\?>+ contains=htmlCommentNested,@htmlPreProc,@Spell keepend |
150 syn match htmlComment "<!---\?>" contains=htmlCommentError | 141 " Idem 8.2.4.49: nested comment is parser error, except <!--> is all right |
151 " Idem 8.2.4.51: any number of consecutive dashes within comment is okay; --> closes comment | 142 syn match htmlCommentNested contained "<!-->\@!" |
152 " Idem 8.2.4.52: closing comment by dash-dash-bang (--!>) is error ignored by parser(!); closes comment | 143 syn match htmlCommentError contained "[^><!]" |
153 syn region htmlCommentPart contained start=+--+ end=+--!\?>+me=e-1 contains=htmlCommentNested,@htmlPreProc,@Spell | 144 endif |
154 " Idem 8.2.4.49: opening nested comment <!-- is parser error, ignored by browser, except <!--> is all right | 145 syn region htmlComment start=+<!DOCTYPE+ end=+>+ keepend |
155 syn match htmlCommentNested contained "<!--[^>]"me=e-1 | |
156 syn match htmlCommentNested contained "<!--->"me=e-3 | |
157 syn match htmlCommentNested contained "<!---\?!>"me=e-4 | |
158 syn match htmlCommentError contained "[^><!]" | |
159 endif | |
160 syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+ | |
161 | 146 |
162 " server-parsed commands | 147 " server-parsed commands |
163 syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr | 148 syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr |
164 syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>" | 149 syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>" |
165 syn match htmlPreError contained "<!--#\S*"ms=s+4 | 150 syn match htmlPreError contained "<!--#\S*"ms=s+4 |
276 hi def link htmlTag Function | 261 hi def link htmlTag Function |
277 hi def link htmlEndTag Identifier | 262 hi def link htmlEndTag Identifier |
278 hi def link htmlArg Type | 263 hi def link htmlArg Type |
279 hi def link htmlTagName htmlStatement | 264 hi def link htmlTagName htmlStatement |
280 hi def link htmlSpecialTagName Exception | 265 hi def link htmlSpecialTagName Exception |
281 hi def link htmlValue String | 266 hi def link htmlValue String |
282 hi def link htmlSpecialChar Special | 267 hi def link htmlSpecialChar Special |
283 | 268 |
284 if !exists("html_no_rendering") | 269 if !exists("html_no_rendering") |
285 hi def link htmlH1 Title | 270 hi def link htmlH1 Title |
286 hi def link htmlH2 htmlH1 | 271 hi def link htmlH2 htmlH1 |
320 hi def link htmlPreError Error | 305 hi def link htmlPreError Error |
321 hi def link htmlPreProc PreProc | 306 hi def link htmlPreProc PreProc |
322 hi def link htmlPreAttr String | 307 hi def link htmlPreAttr String |
323 hi def link htmlPreProcAttrName PreProc | 308 hi def link htmlPreProcAttrName PreProc |
324 hi def link htmlPreProcAttrError Error | 309 hi def link htmlPreProcAttrError Error |
325 hi def link htmlSpecial Special | |
326 hi def link htmlSpecialChar Special | |
327 hi def link htmlString String | 310 hi def link htmlString String |
328 hi def link htmlStatement Statement | 311 hi def link htmlStatement Statement |
329 hi def link htmlComment Comment | 312 hi def link htmlComment Comment |
330 hi def link htmlCommentPart Comment | 313 hi def link htmlCommentNested htmlError |
331 hi def link htmlValue String | |
332 hi def link htmlCommentNested htmlCommentError | |
333 hi def link htmlCommentError htmlError | 314 hi def link htmlCommentError htmlError |
334 hi def link htmlTagError htmlError | 315 hi def link htmlTagError htmlError |
335 hi def link htmlEvent javaScript | 316 hi def link htmlEvent javaScript |
336 hi def link htmlError Error | 317 hi def link htmlError Error |
337 | 318 |