From 1ebce74ab2e42bbff9cde88788690fbd5cd89139 Mon Sep 17 00:00:00 2001 From: "tobias.pitters" Date: Sat, 25 Mar 2023 09:16:28 +0100 Subject: [PATCH] ignore py repl tags --- README.md | 3 ++- dist/index.mjs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae43680..627576a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ This is a precommit hook that applies a patched version of prettier that -recognizes the `py-script` and `py-config` tags and does not reformat their +recognizes the `py-script`, `py-config` and `py-repl` tags and does not reformat their contents. The patch that has been applied to prettier is as follows: ```patch @@ -11,6 +11,7 @@ contents. The patch that has been applied to prettier is as follows: node.type === "element" && - (node.fullName === "script" || + (node.fullName === "py-script" || ++ (node.fullName === "py-repl" || + node.fullName === "py-config" || + node.fullName === "script" || node.fullName === "style" || diff --git a/dist/index.mjs b/dist/index.mjs index 0b7d2fd..7cd15c0 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -32536,7 +32536,7 @@ function isTextLikeNode(node) { return node.type === "text" || node.type === "comment"; } function isScriptLikeTag(node) { - return node.type === "element" && (node.fullName === "py-script" || node.fullName === "py-config" || node.fullName === "script" || node.fullName === "style" || node.fullName === "svg:style" || is_unknown_namespace_default(node) && (node.name === "script" || node.name === "style")); + return node.type === "element" && (node.fullName === "py-script" || node.fullName === "py-repl" || node.fullName === "py-config" || node.fullName === "script" || node.fullName === "style" || node.fullName === "svg:style" || is_unknown_namespace_default(node) && (node.name === "script" || node.name === "style")); } function canHaveInterpolation(node) { return node.children && !isScriptLikeTag(node);