Skip to content

Commit 4b2bd66

Browse files
committed
fix for issue #10
1 parent 8aec3e5 commit 4b2bd66

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { parsers } = require("prettier/parser-html");
77

88
function parse(text, options, legacy) {
99
const find =
10-
/(?:<(textarea|title|script).*?<\/\1|<[a-zA-Z!\s\\].*?(?<!%)>|<%([^>]*)%>)/gs;
10+
/(?:<(textarea|title|script).*?<\/\1|<\s*[a-zA-Z!].*?[^%/]>|<%([^>]*)%>)/gs;
1111
text = text.replace(find, (match, p1, p2) => (p2 ? `<!${p2}!>` : match));
1212
return parsers.html.parse(text, options, legacy);
1313
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "prettier-plugin-ejs",
33
"displayName": "Prettier EJS Plugin",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"description": "A Prettier plugin for Embedded JavaScript Templating (EJS).",
66
"keywords": [
77
"prettier",

0 commit comments

Comments
 (0)