diff --git a/doc/syntastic-checkers.txt b/doc/syntastic-checkers.txt index c983cee3..7453201e 100644 --- a/doc/syntastic-checkers.txt +++ b/doc/syntastic-checkers.txt @@ -3197,7 +3197,7 @@ run the checks against "https://validator.w3.org/", or set it to *'g:syntastic_html_w3_doctype'* Type: string -Default: "" +Default: "HTML5" Name of the document type definition to use for checking. If unspecified, the type is detected from the file content. Currently supported values for HTML: @@ -6697,7 +6697,7 @@ See also: |syntastic-html-validator|, |syntastic-xhtml-validator|. 2. W3 *syntastic-svg-w3* Name: w3 -Maintainer: Martin Grenfell +Maintainer: Kevin Locke "W3" is the W3C Markup Validator for SVG. See the project's page for details: @@ -6727,10 +6727,9 @@ run the checks against "https://validator.w3.org/", or set it to *'g:syntastic_svg_w3_doctype'* Type: string -Default: "SVG 1.1" (if not detected from DTD) -Name of the document type definition to use for checking. If unspecified, the -type is detected from a Document Type Declaration, if present, or "SVG 1.1" is -used. Currently supported values for SVG: +Default: "SVG 1.1" +Name of the document type definition to use for checking. Currently supported +values for SVG: - SVG 1.0 - SVG 1.1 @@ -7768,7 +7767,7 @@ See also: |syntastic-html-validator|, |syntastic-svg-validator|. 5. W3 *syntastic-xhtml-w3* Name: w3 -Maintainer: Martin Grenfell +Maintainer: Kevin Locke "W3" is the W3C Markup Validator for XHTML. See the project's page for details: @@ -7798,7 +7797,7 @@ run the checks against "https://validator.w3.org/", or set it to *'g:syntastic_xhtml_w3_doctype'* Type: string -Default: "" +Default: "XHTML 1.1" Name of the document type definition to use for checking. If unspecified, the type is detected from the file content. Currently supported values for XHTML: diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 5fe99770..b1980c5b 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.9.0-25' +let g:_SYNTASTIC_VERSION = '3.9.0-29' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/syntax_checkers/html/w3.vim b/syntax_checkers/html/w3.vim index 1d9f8d9e..efe898df 100644 --- a/syntax_checkers/html/w3.vim +++ b/syntax_checkers/html/w3.vim @@ -21,43 +21,35 @@ set cpo&vim " Constants {{{1 let s:DEFAULTS = { - \ 'api': 'https://validator.w3.org/check', - \ 'doctype': '' } - -let s:CONTENT_TYPE = { - \ 'html': 'text/html', - \ 'svg': 'image/svg+xml', - \ 'xhtml': 'application/xhtml+xml' } + \ 'html': { + \ 'ctype': 'text/html', + \ 'doctype': 'HTML5' }, + \ 'svg': { + \ 'ctype': 'image/svg+xml', + \ 'doctype': 'SVG 1.1' }, + \ 'xhtml': { + \ 'ctype': 'application/xhtml+xml', + \ 'doctype': 'XHTML 1.1' } } " }}}1 -" @vimlint(EVL101, 1, l:api) +" @vimlint(EVL101, 1, l:ctype) " @vimlint(EVL101, 1, l:doctype) -" @vimlint(EVL104, 1, l:doctype) function! SyntaxCheckers_html_w3_GetLocList() dict " {{{1 let buf = bufnr('') let type = self.getFiletype() let fname = syntastic#util#shescape(fnamemodify(bufname(buf), ':p')) - - for key in keys(s:DEFAULTS) - let l:{key} = syntastic#util#var(type . '_w3_' . key, get(s:DEFAULTS, key)) + let api = syntastic#util#var(type . '_w3_api', 'https://validator.w3.org/check') +. + for key in keys(s:DEFAULTS[type]) + let l:{key} = syntastic#util#var(type . '_w3_' . key, get(s:DEFAULTS[type], key)) endfor - let ctype = get(s:CONTENT_TYPE, type, '') - - " SVG is detected as generic XML if doctype is unspecified. - " Default "SVG 1.1" with "Only if missing" (fbd=1) to use DTD if present. - let fbd = '' - if type ==# 'svg' && doctype ==# '' - let doctype = 'SVG 1.1' - let fbd = '1' - endif " vint: -ProhibitUsingUndeclaredVariable let makeprg = self.getExecEscaped() . ' -q -L -s --compressed -F output=json' . \ (doctype !=# '' ? ' -F doctype=' . syntastic#util#shescape(doctype) : '') . - \ (fbd !=# '' ? ' -F fbd=' . fbd : '') . \ ' -F uploaded_file=@' . fname . - \ (ctype !=# '' ? '\;type=' . ctype : '') . + \ '\;type=' . ctype . \ '\;filename=' . fname . \ ' ' . api " vint: ProhibitUsingUndeclaredVariable @@ -86,8 +78,7 @@ function! SyntaxCheckers_html_w3_GetLocList() dict " {{{1 return loclist endfunction " }}}1 " @vimlint(EVL104, 0, l:doctype) -" @vimlint(EVL101, 0, l:doctype) -" @vimlint(EVL101, 0, l:api) +" @vimlint(EVL101, 0, l:ctype) call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'html',