We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2ce32d2 + e4a90e1 commit 03cf293Copy full SHA for 03cf293
src/plugin/html.js
@@ -1,9 +1,9 @@
1
import { ROOT_ID } from "../common";
2
3
-const escape = (src) => src.replace(/`/g, "\\`");
4
-
5
-export const createContent = (js) =>
6
- `export default String.raw\`${escape(wrapByHtml(js))}\`;`;
+export const createContent = (js) => {
+ js = js.replace(/([`$])/g, '\\$1');
+ return "export default String.raw`\n"+wrapByHtml(js)+"\n`.replace(/\\\\([`$])/g, '\\$1')";
+}
7
8
const wrapByHtml = (js) => `
9
<!DOCTYPE html>
0 commit comments