Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
});
*/

//
// Wrapper function to invoke all the necessary constructors and deal with the output.
//
function style_html(html_source, options) {
//Wrapper function to invoke all the necessary constructors and deal with the output.

var multi_parser,
indent_size,
Expand Down Expand Up @@ -69,7 +71,6 @@ function style_html(html_source, options) {
this.Utils = { //Uilities made available to the various functions
whitespace: "\n\r\t ".split(''),
single_token: 'br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?='.split(','), //all the single tags for HTML
extra_liners: 'head,body,/html'.split(','), //for tags that need a line of whitespace before them
in_array: function (what, arr) {
for (var i=0; i<arr.length; i++) {
if (what === arr[i]) {
Expand Down Expand Up @@ -291,9 +292,6 @@ function style_html(html_source, options) {
this.record_tag(tag_check); //push it on the tag stack
this.tag_type = 'START';
}
if (this.Utils.in_array(tag_check, this.Utils.extra_liners)) { //check if this double needs an extra line
this.print_newline(true, this.output);
}
}
return content.join(''); //returns fully formatted tag
}
Expand Down