mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-30 08:00:55 +00:00
Clean up html tag settings
This commit is contained in:
parent
52740fda30
commit
fe3e18acfe
@ -43,16 +43,19 @@ function Options(options) {
|
|||||||
this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size);
|
this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size);
|
||||||
this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']);
|
this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']);
|
||||||
|
|
||||||
|
// Block vs inline elements
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
|
||||||
|
// https://www.w3.org/TR/html5/dom.html#phrasing-content
|
||||||
this.inline = this._get_array('inline', [
|
this.inline = this._get_array('inline', [
|
||||||
// https://www.w3.org/TR/html5/dom.html#phrasing-content
|
|
||||||
'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',
|
'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',
|
||||||
'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',
|
'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',
|
||||||
'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',
|
'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',
|
||||||
'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',
|
'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',
|
||||||
'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',
|
'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',
|
||||||
'video', 'wbr', 'text',
|
'video', 'wbr', 'text',
|
||||||
// prexisting - not sure of full effect of removing, leaving in
|
// obsolete inline tags
|
||||||
'acronym', 'address', 'big', 'dt', 'ins', 'strike', 'tt'
|
'acronym', 'big', 'strike', 'tt'
|
||||||
]);
|
]);
|
||||||
this.void_elements = this._get_array('void_elements', [
|
this.void_elements = this._get_array('void_elements', [
|
||||||
// HTLM void elements - aka self-closing tags - aka singletons
|
// HTLM void elements - aka self-closing tags - aka singletons
|
||||||
@ -64,9 +67,10 @@ function Options(options) {
|
|||||||
|
|
||||||
// Doctype and xml elements
|
// Doctype and xml elements
|
||||||
'!doctype', '?xml',
|
'!doctype', '?xml',
|
||||||
// ?php and ?= tags
|
|
||||||
'?php', '?=',
|
// obsolete tags
|
||||||
// other tags that were in this list, keeping just in case
|
// basefont: https://www.computerhope.com/jargon/h/html-basefont-tag.htm
|
||||||
|
// isndex: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex
|
||||||
'basefont', 'isindex'
|
'basefont', 'isindex'
|
||||||
]);
|
]);
|
||||||
this.unformatted = this._get_array('unformatted', []);
|
this.unformatted = this._get_array('unformatted', []);
|
||||||
|
Loading…
Reference in New Issue
Block a user