mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 12:20:04 +02:00
update node modules
This commit is contained in:
23
node_modules/parse5/lib/extensions/location-info/parser-mixin.js
generated
vendored
23
node_modules/parse5/lib/extensions/location-info/parser-mixin.js
generated
vendored
@@ -43,17 +43,19 @@ class LocationInfoParserMixin extends Mixin {
|
||||
// NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing
|
||||
// tag and for cases like <td> <p> </td> - 'p' closes without a closing tag.
|
||||
const isClosingEndTag = closingToken.type === Tokenizer.END_TAG_TOKEN && tn === closingToken.tagName;
|
||||
|
||||
const endLoc = {};
|
||||
if (isClosingEndTag) {
|
||||
loc.endTag = Object.assign({}, ctLoc);
|
||||
loc.endLine = ctLoc.endLine;
|
||||
loc.endCol = ctLoc.endCol;
|
||||
loc.endOffset = ctLoc.endOffset;
|
||||
endLoc.endTag = Object.assign({}, ctLoc);
|
||||
endLoc.endLine = ctLoc.endLine;
|
||||
endLoc.endCol = ctLoc.endCol;
|
||||
endLoc.endOffset = ctLoc.endOffset;
|
||||
} else {
|
||||
loc.endLine = ctLoc.startLine;
|
||||
loc.endCol = ctLoc.startCol;
|
||||
loc.endOffset = ctLoc.startOffset;
|
||||
endLoc.endLine = ctLoc.startLine;
|
||||
endLoc.endCol = ctLoc.startCol;
|
||||
endLoc.endOffset = ctLoc.startOffset;
|
||||
}
|
||||
|
||||
this.treeAdapter.updateNodeSourceCodeLocation(element, endLoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,9 +210,8 @@ class LocationInfoParserMixin extends Mixin {
|
||||
const tnLoc = this.treeAdapter.getNodeSourceCodeLocation(textNode);
|
||||
|
||||
if (tnLoc) {
|
||||
tnLoc.endLine = token.location.endLine;
|
||||
tnLoc.endCol = token.location.endCol;
|
||||
tnLoc.endOffset = token.location.endOffset;
|
||||
const { endLine, endCol, endOffset } = token.location;
|
||||
this.treeAdapter.updateNodeSourceCodeLocation(textNode, { endLine, endCol, endOffset });
|
||||
} else {
|
||||
this.treeAdapter.setNodeSourceCodeLocation(textNode, token.location);
|
||||
}
|
||||
|
2
node_modules/parse5/lib/parser/index.js
generated
vendored
2
node_modules/parse5/lib/parser/index.js
generated
vendored
@@ -1546,7 +1546,7 @@ function hrStartTagInBody(p, token) {
|
||||
|
||||
p._appendElement(token, NS.HTML);
|
||||
p.framesetOk = false;
|
||||
p.ackSelfClosing = true;
|
||||
token.ackSelfClosing = true;
|
||||
}
|
||||
|
||||
function imageStartTagInBody(p, token) {
|
||||
|
4
node_modules/parse5/lib/tree-adapters/default.js
generated
vendored
4
node_modules/parse5/lib/tree-adapters/default.js
generated
vendored
@@ -215,3 +215,7 @@ exports.setNodeSourceCodeLocation = function(node, location) {
|
||||
exports.getNodeSourceCodeLocation = function(node) {
|
||||
return node.sourceCodeLocation;
|
||||
};
|
||||
|
||||
exports.updateNodeSourceCodeLocation = function(node, endLocation) {
|
||||
node.sourceCodeLocation = Object.assign(node.sourceCodeLocation, endLocation);
|
||||
};
|
||||
|
Reference in New Issue
Block a user