summaryrefslogtreecommitdiffstats
path: root/syntax/html.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2021-03-01 13:44:50 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2021-03-01 13:44:50 +0100
commitcc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef (patch)
tree260360b1a32ca19635f8c8884b81fcec9ed51168 /syntax/html.vim
parent4c10562d2cc9b084518284c49a158558da5180a7 (diff)
downloadvim-polyglot-cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef.tar.gz
vim-polyglot-cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef.zip
Update
Diffstat (limited to 'syntax/html.vim')
-rw-r--r--syntax/html.vim25
1 files changed, 19 insertions, 6 deletions
diff --git a/syntax/html.vim b/syntax/html.vim
index c823d362..2113f12a 100644
--- a/syntax/html.vim
+++ b/syntax/html.vim
@@ -4,11 +4,11 @@ endif
" 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: 2020 Mar 17
-" Included patch from Florian Breisch to add the summary element
+" Last Change: 2021 Feb 25
+" Included patch #7900 to fix comments
"
" Please check :help html.vim for some comments and a description of the options
@@ -145,9 +145,21 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
if exists("html_wrong_comments")
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-42: bogus comment is parser error; browser skips until next &gt;
+ " Note: must stand first to get lesser :syn-priority
+ syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError
+ " Normal comment opening <!-- ...>
+ syn region htmlComment start=+<!--+ end=+>+ contains=htmlCommentPart,@Spell
+ " Idem 8.2.4.43-44: <!--> and <!---> are parser errors; browser treats as comments
+ syn match htmlComment "<!---\?>" contains=htmlCommentError
+ " Idem 8.2.4.51: any number of consecutive dashes within comment is okay; --> closes comment
+ " Idem 8.2.4.52: closing comment by dash-dash-bang (--!>) is error ignored by parser(!); closes comment
+ syn region htmlCommentPart contained start=+--+ end=+--!\?>+me=e-1 contains=htmlCommentNested,@htmlPreProc,@Spell
+ " Idem 8.2.4.49: opening nested comment <!-- is parser error, ignored by browser, except <!--> is all right
+ syn match htmlCommentNested contained "<!--[^>]"me=e-1
+ syn match htmlCommentNested contained "<!--->"me=e-3
+ syn match htmlCommentNested contained "<!---\?!>"me=e-4
+ syn match htmlCommentError contained "[^><!]"
endif
syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
@@ -321,6 +333,7 @@ hi def link htmlStatement Statement
hi def link htmlComment Comment
hi def link htmlCommentPart Comment
hi def link htmlValue String
+hi def link htmlCommentNested htmlCommentError
hi def link htmlCommentError htmlError
hi def link htmlTagError htmlError
hi def link htmlEvent javaScript