prettier-plugin-ejs 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 1986-2023 Ecmel Ercan (https://ecmel.dev/)
2
+ * Copyright (c) 1986-2024 Ecmel Ercan (https://ecmel.dev/)
3
3
  * Licensed under the MIT License
4
4
  */
5
5
 
@@ -7,7 +7,7 @@ const { parsers } = require("prettier/parser-html");
7
7
 
8
8
  function parse(text, options, legacy) {
9
9
  const find =
10
- /(?:<(textarea|title|script).*?<\/\1|<\s*[a-zA-Z!].*?[^%/]>|<%([^>]*)%>)/gs;
10
+ /(?:<(textarea|title|script).*?<\/\1|<\s*[a-zA-Z!](?:".*?"|.*?)*?[^%]>|<%([^>]*)%>)/gs;
11
11
  text = text.replace(find, (match, p1, p2) => (p2 ? `<!${p2}!>` : match));
12
12
  return parsers.html.parse(text, options, legacy);
13
13
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prettier-plugin-ejs",
3
3
  "displayName": "Prettier EJS Plugin",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "description": "A Prettier plugin for Embedded JavaScript Templating (EJS).",
6
6
  "keywords": [
7
7
  "prettier",