2 var langs = "ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" ");
3 var targets = ["_blank", "_self", "_top", "_parent"];
4 var charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
5 var methods = ["get", "post", "put", "delete"];
6 var encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
7 var media = ["all", "screen", "print", "embossed", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "speech",
8 "3d-glasses", "resolution [>][<][=] [X]", "device-aspect-ratio: X/Y", "orientation:portrait",
9 "orientation:landscape", "device-height: [X]", "device-width: [X]"];
10 var s = { attrs: {} }; // Simple tag, reused for a whole lot of tags
15 href: null, ping: null, type: null,
27 alt: null, coords: null, href: null, target: null, ping: null,
28 media: media, hreflang: langs, type: null,
29 shape: ["default", "rect", "circle", "poly"]
36 src: null, mediagroup: null,
37 crossorigin: ["anonymous", "use-credentials"],
38 preload: ["none", "metadata", "auto"],
39 autoplay: ["", "autoplay"],
41 controls: ["", "controls"]
45 base: { attrs: { href: null, target: targets } },
50 blockquote: { attrs: { cite: null } },
55 form: null, formaction: null, name: null, value: null,
56 autofocus: ["", "autofocus"],
57 disabled: ["", "autofocus"],
60 formnovalidate: ["", "novalidate"],
62 type: ["submit", "reset", "button"]
65 canvas: { attrs: { width: null, height: null } },
70 col: { attrs: { span: null } },
71 colgroup: { attrs: { span: null } },
74 type: ["command", "checkbox", "radio"],
75 label: null, icon: null, radiogroup: null, command: null, title: null,
76 disabled: ["", "disabled"],
77 checked: ["", "checked"]
80 data: { attrs: { value: null } },
81 datagrid: { attrs: { disabled: ["", "disabled"], multiple: ["", "multiple"] } },
82 datalist: { attrs: { data: null } },
84 del: { attrs: { cite: null, datetime: null } },
85 details: { attrs: { open: ["", "open"] } },
92 embed: { attrs: { src: null, type: null, width: null, height: null } },
93 eventsource: { attrs: { src: null } },
94 fieldset: { attrs: { disabled: ["", "disabled"], form: null, name: null } },
101 action: null, name: null,
102 "accept-charset": charsets,
103 autocomplete: ["on", "off"],
106 novalidate: ["", "novalidate"],
112 h1: s, h2: s, h3: s, h4: s, h5: s, h6: s,
115 children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
121 attrs: { manifest: null },
122 children: ["head", "body"]
127 src: null, srcdoc: null, name: null, width: null, height: null,
128 sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
129 seamless: ["", "seamless"]
134 alt: null, src: null, ismap: null, usemap: null, width: null, height: null,
135 crossorigin: ["anonymous", "use-credentials"]
140 alt: null, dirname: null, form: null, formaction: null,
141 height: null, list: null, max: null, maxlength: null, min: null,
142 name: null, pattern: null, placeholder: null, size: null, src: null,
143 step: null, value: null, width: null,
144 accept: ["audio/*", "video/*", "image/*"],
145 autocomplete: ["on", "off"],
146 autofocus: ["", "autofocus"],
147 checked: ["", "checked"],
148 disabled: ["", "disabled"],
151 formnovalidate: ["", "novalidate"],
153 multiple: ["", "multiple"],
154 readonly: ["", "readonly"],
155 required: ["", "required"],
156 type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month",
157 "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio",
158 "file", "submit", "image", "reset", "button"]
161 ins: { attrs: { cite: null, datetime: null } },
165 challenge: null, form: null, name: null,
166 autofocus: ["", "autofocus"],
167 disabled: ["", "disabled"],
171 label: { attrs: { "for": null, form: null } },
173 li: { attrs: { value: null } },
176 href: null, type: null,
179 sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
182 map: { attrs: { name: null } },
184 menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
189 name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
190 "http-equiv": ["content-language", "content-type", "default-style", "refresh"]
193 meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
199 data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,
200 typemustmatch: ["", "typemustmatch"]
203 ol: { attrs: { reversed: ["", "reversed"], start: null, type: ["1", "a", "A", "i", "I"] } },
204 optgroup: { attrs: { disabled: ["", "disabled"], label: null } },
205 option: { attrs: { disabled: ["", "disabled"], label: null, selected: ["", "selected"], value: null } },
206 output: { attrs: { "for": null, form: null, name: null } },
208 param: { attrs: { name: null, value: null } },
210 progress: { attrs: { value: null, max: null } },
211 q: { attrs: { cite: null } },
219 type: ["text/javascript"],
221 async: ["", "async"],
222 defer: ["", "defer"],
229 form: null, name: null, size: null,
230 autofocus: ["", "autofocus"],
231 disabled: ["", "disabled"],
232 multiple: ["", "multiple"]
236 source: { attrs: { src: null, type: null, media: null } },
252 td: { attrs: { colspan: null, rowspan: null, headers: null } },
255 dirname: null, form: null, maxlength: null, name: null, placeholder: null,
256 rows: null, cols: null,
257 autofocus: ["", "autofocus"],
258 disabled: ["", "disabled"],
259 readonly: ["", "readonly"],
260 required: ["", "required"],
261 wrap: ["soft", "hard"]
265 th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
267 time: { attrs: { datetime: null } },
272 src: null, label: null, "default": null,
273 kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
283 src: null, poster: null, width: null, height: null,
284 crossorigin: ["anonymous", "use-credentials"],
285 preload: ["auto", "metadata", "none"],
286 autoplay: ["", "autoplay"],
287 mediagroup: ["movie"],
288 muted: ["", "muted"],
289 controls: ["", "controls"]
296 accesskey: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
298 contenteditable: ["true", "false"],
300 dir: ["ltr", "rtl", "auto"],
301 draggable: ["true", "false", "auto"],
302 dropzone: ["copy", "move", "link", "string:", "file:"],
309 itemscope: ["itemscope"],
312 spellcheck: ["true", "false"],
314 tabindex: ["1", "2", "3", "4", "5", "6", "7", "8", "9"],
316 translate: ["yes", "no"],
318 rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"]
320 function populate(obj) {
321 for (var attr in globalAttrs) if (globalAttrs.hasOwnProperty(attr))
322 obj.attrs[attr] = globalAttrs[attr];
326 for (var tag in data) if (data.hasOwnProperty(tag) && data[tag] != s)
329 CodeMirror.htmlSchema = data;
330 function htmlHint(cm, options) {
331 var local = {schemaInfo: data};
332 if (options) for (var opt in options) local[opt] = options[opt];
333 return CodeMirror.hint.xml(cm, local);
335 CodeMirror.htmlHint = htmlHint; // deprecated
336 CodeMirror.registerHelper("hint", "html", htmlHint);