aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/html.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-04 19:18:16 -0400
committerGitHub <noreply@github.com>2021-05-04 19:18:16 -0400
commit4ad30f775e5564c539324b4818886f067d2ecd99 (patch)
tree97a554379bda7e5fc77e58c690db3f5a72db8c74 /runtime/syntax/html.vim
parent63d8a8f4e8b02e524d85aed08aa16c5d9815598c (diff)
parentd5b063aec1db95704b37a77fdbd968cb6b48cc3b (diff)
downloadrneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.gz
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.bz2
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.zip
Merge pull request #14424 from janlazo/vim-8.1.1726
vim-patch:8.1.1726,8.2.{296,860,1827,2388,2788,2790,2801}
Diffstat (limited to 'runtime/syntax/html.vim')
-rw-r--r--runtime/syntax/html.vim79
1 files changed, 37 insertions, 42 deletions
diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim
index d16ee1817f..8ccb5574e7 100644
--- a/runtime/syntax/html.vim
+++ b/runtime/syntax/html.vim
@@ -1,10 +1,11 @@
" Vim syntax file
" Language: HTML
-" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
+" Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
-" Last Change: 2018 Apr 7
-" Included patch from Jorge Maldonado Ventura to fix rendering
+" Last Change: 2021 Mar 02
+" Included patch #7900 to fix comments
+" Included patch #7916 to fix a few more things
"
" Please check :help html.vim for some comments and a description of the options
@@ -57,11 +58,12 @@ syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
" new html 5 tags
syn keyword htmlTagName contained article aside audio bdi canvas data
-syn keyword htmlTagName contained datalist details embed figcaption figure
-syn keyword htmlTagName contained footer header hgroup keygen main mark
-syn keyword htmlTagName contained menuitem meter nav output picture
+syn keyword htmlTagName contained datalist details dialog embed figcaption
+syn keyword htmlTagName contained figure footer header hgroup keygen main
+syn keyword htmlTagName contained mark menuitem meter nav output picture
syn keyword htmlTagName contained progress rb rp rt rtc ruby section
-syn keyword htmlTagName contained slot source template time track video wbr
+syn keyword htmlTagName contained slot source summary template time track
+syn keyword htmlTagName contained video wbr
" legal arg names
syn keyword htmlArg contained action
@@ -78,26 +80,16 @@ syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
" aria attributes
-syn match htmlArg contained "\<\(aria-activedescendant\|aria-atomic\)\>"
-syn match htmlArg contained "\<\(aria-autocomplete\|aria-busy\|aria-checked\)\>"
-syn match htmlArg contained "\<\(aria-colcount\|aria-colindex\|aria-colspan\)\>"
-syn match htmlArg contained "\<\(aria-controls\|aria-current\)\>"
-syn match htmlArg contained "\<\(aria-describedby\|aria-details\)\>"
-syn match htmlArg contained "\<\(aria-disabled\|aria-dropeffect\)\>"
-syn match htmlArg contained "\<\(aria-errormessage\|aria-expanded\)\>"
-syn match htmlArg contained "\<\(aria-flowto\|aria-grabbed\|aria-haspopup\)\>"
-syn match htmlArg contained "\<\(aria-hidden\|aria-invalid\)\>"
-syn match htmlArg contained "\<\(aria-keyshortcuts\|aria-label\)\>"
-syn match htmlArg contained "\<\(aria-labelledby\|aria-level\|aria-live\)\>"
-syn match htmlArg contained "\<\(aria-modal\|aria-multiline\)\>"
-syn match htmlArg contained "\<\(aria-multiselectable\|aria-orientation\)\>"
-syn match htmlArg contained "\<\(aria-owns\|aria-placeholder\|aria-posinset\)\>"
-syn match htmlArg contained "\<\(aria-pressed\|aria-readonly\|aria-relevant\)\>"
-syn match htmlArg contained "\<\(aria-required\|aria-roledescription\)\>"
-syn match htmlArg contained "\<\(aria-rowcount\|aria-rowindex\|aria-rowspan\)\>"
-syn match htmlArg contained "\<\(aria-selected\|aria-setsize\|aria-sort\)\>"
-syn match htmlArg contained "\<\(aria-valuemax\|aria-valuemin\)\>"
-syn match htmlArg contained "\<\(aria-valuenow\|aria-valuetext\)\>"
+exe 'syn match htmlArg contained "\<aria-\%(' . join([
+ \ 'activedescendant', 'atomic', 'autocomplete', 'busy', 'checked', 'colcount',
+ \ 'colindex', 'colspan', 'controls', 'current', 'describedby', 'details',
+ \ 'disabled', 'dropeffect', 'errormessage', 'expanded', 'flowto', 'grabbed',
+ \ 'haspopup', 'hidden', 'invalid', 'keyshortcuts', 'label', 'labelledby', 'level',
+ \ 'live', 'modal', 'multiline', 'multiselectable', 'orientation', 'owns',
+ \ 'placeholder', 'posinset', 'pressed', 'readonly', 'relevant', 'required',
+ \ 'roledescription', 'rowcount', 'rowindex', 'rowspan', 'selected', 'setsize',
+ \ 'sort', 'valuemax', 'valuemin', 'valuenow', 'valuetext'
+ \ ], '\|') . '\)\>"'
syn keyword htmlArg contained role
" Netscape extensions
@@ -123,11 +115,11 @@ syn keyword htmlArg contained summary tabindex valuetype version
" html 5 arg names
syn keyword htmlArg contained allowfullscreen async autocomplete autofocus
syn keyword htmlArg contained autoplay challenge contenteditable contextmenu
-syn keyword htmlArg contained controls crossorigin default dialog dirname
-syn keyword htmlArg contained download draggable dropzone form formaction
-syn keyword htmlArg contained formenctype formmethod formnovalidate formtarget
-syn keyword htmlArg contained hidden high icon inputmode keytype kind list loop
-syn keyword htmlArg contained low max min minlength muted nonce novalidate open
+syn keyword htmlArg contained controls crossorigin default dirname download
+syn keyword htmlArg contained draggable dropzone form formaction formenctype
+syn keyword htmlArg contained formmethod formnovalidate formtarget hidden
+syn keyword htmlArg contained high icon inputmode keytype kind list loop low
+syn keyword htmlArg contained max min minlength muted nonce novalidate open
syn keyword htmlArg contained optimum pattern placeholder poster preload
syn keyword htmlArg contained radiogroup required reversed sandbox spellcheck
syn keyword htmlArg contained sizes srcset srcdoc srclang step title translate
@@ -138,13 +130,19 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
" Comments (the real ones or the old netscape ones)
if exists("html_wrong_comments")
- syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
+ syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
else
- syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError,@Spell
- syn match htmlCommentError contained "[^><!]"
- syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
+ " The HTML 5.2 syntax 8.2.4.41: bogus comment is parser error; browser skips until next &gt
+ syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError keepend
+ " Idem 8.2.4.42,51: Comment starts with <!-- and ends with -->
+ " Idem 8.2.4.43,44: Except <!--> and <!---> are parser errors
+ " Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment
+ syn region htmlComment matchgroup=htmlComment start=+<!--\%(-\?>\)\@!+ end=+--!\?>+ contains=htmlCommentNested,@htmlPreProc,@Spell keepend
+ " Idem 8.2.4.49: nested comment is parser error, except <!--> is all right
+ syn match htmlCommentNested contained "<!-->\@!"
+ syn match htmlCommentError contained "[^><!]"
endif
-syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
+syn region htmlComment start=+<!DOCTYPE+ end=+>+ keepend
" server-parsed commands
syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
@@ -265,7 +263,7 @@ hi def link htmlEndTag Identifier
hi def link htmlArg Type
hi def link htmlTagName htmlStatement
hi def link htmlSpecialTagName Exception
-hi def link htmlValue String
+hi def link htmlValue String
hi def link htmlSpecialChar Special
if !exists("html_no_rendering")
@@ -309,13 +307,10 @@ hi def link htmlPreProc PreProc
hi def link htmlPreAttr String
hi def link htmlPreProcAttrName PreProc
hi def link htmlPreProcAttrError Error
-hi def link htmlSpecial Special
-hi def link htmlSpecialChar Special
hi def link htmlString String
hi def link htmlStatement Statement
hi def link htmlComment Comment
-hi def link htmlCommentPart Comment
-hi def link htmlValue String
+hi def link htmlCommentNested htmlError
hi def link htmlCommentError htmlError
hi def link htmlTagError htmlError
hi def link htmlEvent javaScript