Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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" ||
Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down