Skip to content

Commit

Permalink
Merge pull request #361 from titoBouzout/validateoff
Browse files Browse the repository at this point in the history
respect `validate` config setting for validation of whole partial
  • Loading branch information
ryansolid authored Oct 7, 2024
2 parents 2415f6b + 0de2e87 commit 5a520ec
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/babel-plugin-jsx-dom-expressions/src/shared/postprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ export default path => {
);
}
if (path.scope.data.templates?.length) {
for (const template of path.scope.data.templates) {
const html = template.templateWithClosingTags;
// not sure when/why this is not a string
if (typeof html === "string") {
const result = isInvalidMarkup(html);
if (result) {
const message =
"The HTML provided is malformed and will yield unexpected output when evaluated by a browser.\n";
console.warn(message);
console.log(diff(result.html, result.browser));
console.warn("Original HTML:\n", html);
// throw path.buildCodeFrameError();
if (path.hub.file.metadata.config.validate) {
for (const template of path.scope.data.templates) {
const html = template.templateWithClosingTags;
// not sure when/why this is not a string
if (typeof html === "string") {
const result = isInvalidMarkup(html);
if (result) {
const message =
"\nThe HTML provided is malformed and will yield unexpected output when evaluated by a browser.\n";
console.warn(message);
console.log(diff(result.html, result.browser));
console.warn("Original HTML:\n", html);
// throw path.buildCodeFrameError();
}
}
}
}
Expand Down

0 comments on commit 5a520ec

Please sign in to comment.