Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 8c76c04

Browse files
committed
Checker html/w3: cleanup.
2 parents 83a7a2a + fca2caf commit 8c76c04

File tree

3 files changed

+24
-34
lines changed

3 files changed

+24
-34
lines changed

doc/syntastic-checkers.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,7 +3197,7 @@ run the checks against "https://validator.w3.org/", or set it to
31973197

31983198
*'g:syntastic_html_w3_doctype'*
31993199
Type: string
3200-
Default: ""
3200+
Default: "HTML5"
32013201
Name of the document type definition to use for checking. If unspecified, the
32023202
type is detected from the file content. Currently supported values for HTML:
32033203

@@ -6697,7 +6697,7 @@ See also: |syntastic-html-validator|, |syntastic-xhtml-validator|.
66976697
2. W3 *syntastic-svg-w3*
66986698

66996699
Name: w3
6700-
Maintainer: Martin Grenfell <[email protected]>
6700+
Maintainer: Kevin Locke <[email protected]>
67016701

67026702
"W3" is the W3C Markup Validator for SVG. See the project's page for
67036703
details:
@@ -6727,10 +6727,9 @@ run the checks against "https://validator.w3.org/", or set it to
67276727

67286728
*'g:syntastic_svg_w3_doctype'*
67296729
Type: string
6730-
Default: "SVG 1.1" (if not detected from DTD)
6731-
Name of the document type definition to use for checking. If unspecified, the
6732-
type is detected from a Document Type Declaration, if present, or "SVG 1.1" is
6733-
used. Currently supported values for SVG:
6730+
Default: "SVG 1.1"
6731+
Name of the document type definition to use for checking. Currently supported
6732+
values for SVG:
67346733

67356734
- SVG 1.0
67366735
- SVG 1.1
@@ -7768,7 +7767,7 @@ See also: |syntastic-html-validator|, |syntastic-svg-validator|.
77687767
5. W3 *syntastic-xhtml-w3*
77697768

77707769
Name: w3
7771-
Maintainer: Martin Grenfell <[email protected]>
7770+
Maintainer: Kevin Locke <[email protected]>
77727771

77737772
"W3" is the W3C Markup Validator for XHTML. See the project's page for
77747773
details:
@@ -7798,7 +7797,7 @@ run the checks against "https://validator.w3.org/", or set it to
77987797

77997798
*'g:syntastic_xhtml_w3_doctype'*
78007799
Type: string
7801-
Default: ""
7800+
Default: "XHTML 1.1"
78027801
Name of the document type definition to use for checking. If unspecified, the
78037802
type is detected from the file content. Currently supported values for XHTML:
78047803

plugin/syntastic.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if has('reltime')
1919
lockvar! g:_SYNTASTIC_START
2020
endif
2121

22-
let g:_SYNTASTIC_VERSION = '3.9.0-25'
22+
let g:_SYNTASTIC_VERSION = '3.9.0-29'
2323
lockvar g:_SYNTASTIC_VERSION
2424

2525
" Sanity checks {{{1

syntax_checkers/html/w3.vim

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,35 @@ set cpo&vim
2121
" Constants {{{1
2222

2323
let s:DEFAULTS = {
24-
\ 'api': 'https://validator.w3.org/check',
25-
\ 'doctype': '' }
26-
27-
let s:CONTENT_TYPE = {
28-
\ 'html': 'text/html',
29-
\ 'svg': 'image/svg+xml',
30-
\ 'xhtml': 'application/xhtml+xml' }
24+
\ 'html': {
25+
\ 'ctype': 'text/html',
26+
\ 'doctype': 'HTML5' },
27+
\ 'svg': {
28+
\ 'ctype': 'image/svg+xml',
29+
\ 'doctype': 'SVG 1.1' },
30+
\ 'xhtml': {
31+
\ 'ctype': 'application/xhtml+xml',
32+
\ 'doctype': 'XHTML 1.1' } }
3133

3234
" }}}1
3335

34-
" @vimlint(EVL101, 1, l:api)
36+
" @vimlint(EVL101, 1, l:ctype)
3537
" @vimlint(EVL101, 1, l:doctype)
36-
" @vimlint(EVL104, 1, l:doctype)
3738
function! SyntaxCheckers_html_w3_GetLocList() dict " {{{1
3839
let buf = bufnr('')
3940
let type = self.getFiletype()
4041
let fname = syntastic#util#shescape(fnamemodify(bufname(buf), ':p'))
41-
42-
for key in keys(s:DEFAULTS)
43-
let l:{key} = syntastic#util#var(type . '_w3_' . key, get(s:DEFAULTS, key))
42+
let api = syntastic#util#var(type . '_w3_api', 'https://validator.w3.org/check')
43+
.
44+
for key in keys(s:DEFAULTS[type])
45+
let l:{key} = syntastic#util#var(type . '_w3_' . key, get(s:DEFAULTS[type], key))
4446
endfor
45-
let ctype = get(s:CONTENT_TYPE, type, '')
46-
47-
" SVG is detected as generic XML if doctype is unspecified.
48-
" Default "SVG 1.1" with "Only if missing" (fbd=1) to use DTD if present.
49-
let fbd = ''
50-
if type ==# 'svg' && doctype ==# ''
51-
let doctype = 'SVG 1.1'
52-
let fbd = '1'
53-
endif
5447

5548
" vint: -ProhibitUsingUndeclaredVariable
5649
let makeprg = self.getExecEscaped() . ' -q -L -s --compressed -F output=json' .
5750
\ (doctype !=# '' ? ' -F doctype=' . syntastic#util#shescape(doctype) : '') .
58-
\ (fbd !=# '' ? ' -F fbd=' . fbd : '') .
5951
\ ' -F uploaded_file=@' . fname .
60-
\ (ctype !=# '' ? '\;type=' . ctype : '') .
52+
\ '\;type=' . ctype .
6153
\ '\;filename=' . fname .
6254
\ ' ' . api
6355
" vint: ProhibitUsingUndeclaredVariable
@@ -86,8 +78,7 @@ function! SyntaxCheckers_html_w3_GetLocList() dict " {{{1
8678
return loclist
8779
endfunction " }}}1
8880
" @vimlint(EVL104, 0, l:doctype)
89-
" @vimlint(EVL101, 0, l:doctype)
90-
" @vimlint(EVL101, 0, l:api)
81+
" @vimlint(EVL101, 0, l:ctype)
9182

9283
call g:SyntasticRegistry.CreateAndRegisterChecker({
9384
\ 'filetype': 'html',

0 commit comments

Comments
 (0)