" Vim syntax file
" Language:	HTML
" Maintainer:	Claudio Fleiner <fleiner@acm.org>
" Last change:	1997 May 27

" Remove any old syntax stuff hanging around
syntax clear

" Only tags and special chars (&auml;) are highlighted 
" Known tag names and arg names are colored the same way
" as statements and types, while unknwon ones as function.

" server-parserd commands (not 100% correct, but works in most cases)
syntax region htmlPreProc start=+<!--#+ end=+-->+
" comments (not 100% correct, but works in most cases)
syntax region htmlComment start=+<!--+ end=+-->+

syntax case ignore

" tag names
syntax keyword htmlTagName contained address applet area a base basefont
syntax keyword htmlTagName contained big blockquote body br b caption center
syntax keyword htmlTagName contained cite code dd dfn dir div dl dt em font
syntax keyword htmlTagName contained form h1 h2 h3 h4 h5 h6 head hr html img
syntax keyword htmlTagName contained input isindex i kbd link li map menu
syntax keyword htmlTagName contained meta ol option param pre p samp script
syntax keyword htmlTagName contained select small strike strong style sub sup
syntax keyword htmlTagName contained table td textarea th title tr tt ul u var

" legal arg names
syntax keyword htmlArg contained action
syntax keyword htmlArg contained align alink alt background bgcolor
syntax keyword htmlArg contained border bordercolor cellpadding
syntax keyword htmlArg contained cellspacing clear code codebase color
syntax keyword htmlArg contained cols colspan content coords enctype face
syntax keyword htmlArg contained frameborder gutter height href hspace
syntax keyword htmlArg contained http-equiv link lowsrc marginheight
syntax keyword htmlArg contained marginwidth maxlength method name prompt
syntax keyword htmlArg contained rel rev rows rowspan scrolling shape
syntax keyword htmlArg contained size src start target text type url
syntax keyword htmlArg contained usemap value vlink vspace width wrap

syntax match   htmlSpecial           contained "\\[0-9][0-9][0-9]\|\\."
syntax region  htmlString          contained start=+"+  skip=+\\\\\|\\"+  end=+"+  contains htmlSpecial
syntax match htmlValue contained "=[	 ]*[^" 	>][^ 	>]*"s+1
syntax region htmlTag start=+</*+ end=+>+ contains htmlString htmlTagName htmlArg htmlValue

" special characters
syntax match htmlSpecialChar	"&[^;]*;"

if !exists("did_html_syntax_inits")
  let did_html_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  highlight link htmlFunction	Function
  highlight link htmlTag	Function
  highlight link htmlFuncDef	Function
  highlight link htmlArg	Type
  highlight link htmlTagName	htmlStatement
  highlight link htmlValue	Value
  highlight link htmlSpecialChar Special

  highlight link htmlSpecial 	Special
  highlight link htmlSpecialChar 	Special
  highlight link htmlString 	String
  highlight link htmlCharacter	Character
  highlight link htmlSpecialCharacter	htmlValue
  highlight link htmlNumber 	Number
  highlight link htmlStatement	Statement
  highlight link htmlComment	Comment
  highlight link htmlPreProc	PreProc
  highlight link htmlType	Type
  highlight link htmlValue	String
endif
