|
1 | | -import { Doctypes, Doctype } from '../types/doctypes'; |
| 1 | +import { create } from '../utils/create'; |
| 2 | +import { Doctype } from '../types/doctypes'; |
2 | 3 |
|
3 | | -export { Doctypes, Doctype }; |
| 4 | +const validate = create<Doctype>(); |
4 | 5 |
|
5 | | -export const doctypes: Doctypes = { |
6 | | - 'HTML 5': { |
| 6 | +export const doctypes = validate({ |
| 7 | + 'html-5': { |
7 | 8 | description: |
8 | 9 | 'A doctype declaration which is very short, due to its lack of references to a Document Type Definition (DTD) in the form of a URL or FPI. All it contains is the tag name of the root element of the document, HTML.', |
9 | 10 | element: 'html', |
10 | 11 | keyword: null, |
11 | 12 | publicIdentifier: null, |
12 | 13 | systemIdentifier: null, |
13 | 14 | }, |
14 | | - 'HTML 4.01 Strict': { |
| 15 | + 'html-4.01-strict': { |
15 | 16 | description: |
16 | 17 | 'A strict doctype declaration which validates against the HTML 4.01 spec, although it doesn\'t allow any presentational markup or deprecated elements (such as `<font>` elements) or framesets to be used. It validates loose HTML style markup, such as minimized attributes and non-quoted attributes (eg required, rather than required="required")', |
17 | 18 | element: 'HTML', |
18 | 19 | keyword: 'PUBLIC', |
19 | 20 | publicIdentifier: '-//W3C//DTD HTML 4.01//EN', |
20 | 21 | systemIdentifier: 'http://www.w3.org/TR/html4/strict.dtd', |
21 | 22 | }, |
22 | | - 'HTML 4.01 Transitional': { |
| 23 | + 'html-4.01-transitional': { |
23 | 24 | description: |
24 | 25 | 'A transitional doctype declaration which validates against the HTML 4.01 spec. It allows some presentational markup and deprecated elements (such as <font> elements) but not framesets. It validates loose HTML style markup, such as minimized attributes and non-quoted attributes (eg required, rather than required="required")', |
25 | 26 | element: 'HTML', |
26 | 27 | keyword: 'PUBLIC', |
27 | 28 | publicIdentifier: '-//W3C//DTD HTML 4.01 Transitional//EN', |
28 | 29 | systemIdentifier: 'http://www.w3.org/TR/html4/loose.dtd', |
29 | 30 | }, |
30 | | - 'XHTML 1.1': { |
| 31 | + 'xhtml-1.1': { |
31 | 32 | description: '', |
32 | 33 | element: 'html', |
33 | 34 | keyword: 'PUBLIC', |
34 | 35 | publicIdentifier: '-//W3C//DTD XHTML 1.1//EN', |
35 | 36 | systemIdentifier: 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd', |
36 | 37 | }, |
37 | | - 'XHTML 1.0 Strict': { |
| 38 | + 'xhtml-1.0-strict': { |
38 | 39 | description: |
39 | 40 | "A strict doctype declaration which validates against the HTML 4.01 spec, although it doesn't allow any presentational markup or deprecated elements (such as `<font>` elements) or framesets to be used. Unlike the `HTML 4.01 Strict` doctype, it does not validate loose HTML style markup.", |
40 | 41 | element: 'html', |
41 | 42 | keyword: 'PUBLIC', |
42 | 43 | publicIdentifier: '-//W3C//DTD XHTML 1.0 Strict//EN', |
43 | 44 | systemIdentifier: 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd', |
44 | 45 | }, |
45 | | - 'XHTML 1.0 Transitional': { |
| 46 | + 'xhtml-1.0-transitional': { |
46 | 47 | description: |
47 | 48 | 'A transitional doctype declaration which validates against the HTML 4.01 spec. It allows some presentational markup and deprecated elements (such as <font> elements) but not framesets. Unlike the `HTML 4.01 Transitional` doctype, it does not validate loose HTML style markup.', |
48 | 49 | element: 'html', |
49 | 50 | keyword: 'PUBLIC', |
50 | 51 | publicIdentifier: '-//W3C//DTD XHTML 1.0 Transitional//EN', |
51 | 52 | systemIdentifier: 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd', |
52 | 53 | }, |
53 | | -}; |
| 54 | +}); |
| 55 | + |
| 56 | +export default doctypes; |
0 commit comments