Comparing version 1.0.0 to 1.0.1
@@ -35,3 +35,10 @@ var defaultTreeAdapter = require('../tree_adapters/default'), | ||
//Enquote doctype ID | ||
function enquoteDoctypeId(id) { | ||
var quote = id.indexOf('"') !== -1 ? '\'' : '"'; | ||
return quote + id + quote; | ||
} | ||
//TreeSerializer | ||
@@ -92,4 +99,8 @@ var TreeSerializer = module.exports = function (treeAdapter) { | ||
if (firstChild && this.treeAdapter.isTextNode(firstChild)) | ||
this.html += '\n'; | ||
if (firstChild && this.treeAdapter.isTextNode(firstChild)) { | ||
var content = this.treeAdapter.getTextNodeContent(firstChild); | ||
if (content[0] === '\n') | ||
this.html += '\n'; | ||
} | ||
} | ||
@@ -159,10 +170,13 @@ | ||
if (publicId !== null) | ||
this.html += ' PUBLIC "' + publicId + '"'; | ||
this.html += ' PUBLIC ' + enquoteDoctypeId(publicId); | ||
else if (systemId !== null) | ||
this.html += ' SYSTEM'; | ||
if (systemId !== null) | ||
this.html += ' "' + systemId + '"'; | ||
this.html += ' ' + enquoteDoctypeId(systemId); | ||
this.html += '>'; | ||
}; | ||
{ | ||
"name": "parse5", | ||
"description": "Fast full-featured HTML parser for Node. Based on WHATWG HTML5 specification.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin)", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
363308
5823