@percy/dom
Advanced tools
Comparing version 1.27.5-alpha.0 to 1.27.5-beta.0
@@ -544,3 +544,4 @@ (function() { | ||
stringifyResponse = options === null || options === void 0 ? void 0 : options.stringify_response, | ||
disableShadowDOM = options === null || options === void 0 ? void 0 : options.disable_shadow_dom | ||
disableShadowDOM = options === null || options === void 0 ? void 0 : options.disable_shadow_dom, | ||
reshuffleInvalidTags = options === null || options === void 0 ? void 0 : options.reshuffle_invalid_tags | ||
} = options || {}; | ||
@@ -552,2 +553,3 @@ | ||
warnings: new Set(), | ||
hints: new Set(), | ||
cache: new Map(), | ||
@@ -574,6 +576,16 @@ enableJavaScript, | ||
} | ||
if (reshuffleInvalidTags) { | ||
let clonedBody = ctx.clone.body; | ||
while (clonedBody.nextSibling) { | ||
let sibling = clonedBody.nextSibling; | ||
clonedBody.append(sibling); | ||
} | ||
} else if (ctx.clone.body.nextSibling) { | ||
ctx.hints.add('DOM elements found outside </body>'); | ||
} | ||
let result = { | ||
html: serializeHTML(ctx), | ||
warnings: Array.from(ctx.warnings), | ||
resources: Array.from(ctx.resources) | ||
resources: Array.from(ctx.resources), | ||
hints: Array.from(ctx.hints) | ||
}; | ||
@@ -580,0 +592,0 @@ return stringifyResponse ? JSON.stringify(result) : result; |
{ | ||
"name": "@percy/dom", | ||
"version": "1.27.5-alpha.0", | ||
"version": "1.27.5-beta.0", | ||
"license": "MIT", | ||
@@ -12,3 +12,3 @@ "repository": { | ||
"access": "public", | ||
"tag": "alpha" | ||
"tag": "latest" | ||
}, | ||
@@ -39,3 +39,3 @@ "main": "dist/bundle.js", | ||
}, | ||
"gitHead": "8ecc32db25f708a01192b8454d0fdf9c051f48a0" | ||
"gitHead": "5fed59aa21112e7854a414306504ce7243df7365" | ||
} |
@@ -40,3 +40,4 @@ # @percy/dom | ||
- `domTransformation` — Function to transform the DOM after serialization | ||
- `disableShadowDOM` — disable shadow DOM capturing, this option can be passed to `percySnapshot` its part of per-snapshot config. | ||
- `disableShadowDOM` — disable shadow DOM capturing, usually to be used when `enableJavascript: true` | ||
- `reshuffleInvalidTags` — moves DOM tags which are outside `</body>` to its inside to make the DOM compliant. | ||
@@ -43,0 +44,0 @@ ## Serialized Content |
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
29891
549
117