Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmel committed Aug 7, 2023
1 parent b45626c commit 5d4656f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Please check [Prettier Docs](https://prettier.io/docs/en/plugins.html) for other
</div>

<div class="<%= red %>"><%= 1 > 0 %></div>

<textarea><%= text %></textarea>
<code><%= text %></code>
<pre><%= text %></pre>
Expand All @@ -60,6 +61,7 @@ Please check [Prettier Docs](https://prettier.io/docs/en/plugins.html) for other
</div>

<div class="<%= red %>"><%= 1 > 0 %></div>

<textarea><%= text %></textarea>
<code><%= text %></code>
<pre><%= text %></pre>
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { parsers } = require("prettier/parser-html");

const regex =
/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|<title.*?<\/title|<textarea.*?<\/textarea|(<%([^>]*?)%>)/gs;
/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|<(?:title|textarea).*?<\/|(<%([^>]*?)%>)/gs;

const replacer = (m, t, c) => (!t ? m : `<!${c}!>`);

Expand Down
18 changes: 15 additions & 3 deletions test.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<title><%= title %></title>
<title><%= text %></title>
</head>
<body>
<div>
Expand All @@ -17,10 +17,22 @@
%>
</div>

<div class="<%= red %>"><%= 1 > 0 %></div>
<div class="<%= text %>"><%= 1 > 0 %></div>

<textarea><%= text %></textarea>
<code><%= text %></code>
<pre><%= text %></pre>
<a href="<%= text %>"><%= text %></a>

<table>
<tr>
<td>
<%= text %>
<%= text %>
</td>
<td><%= text %></td>
</tr>
</table>
</div>
</body>
</html>

0 comments on commit 5d4656f

Please sign in to comment.