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.
1 parent f8d2eb7 commit 35da437Copy full SHA for 35da437
src/plugin/transformer.js
@@ -68,13 +68,15 @@ module.exports.transform = async (args) => {
68
return metroTransformer.transform(args);
69
};
70
71
+const escape = (src) => src.replace(/`/g, "\\`");
72
+
73
const injectString = (src) => {
- return `export default String.raw\`${src.replace(/`/g, "\\`")}\``;
74
+ return `export default String.raw\`${escape(src)}\``;
75
76
77
const injectCss = (src) => `
78
(function () {
- var css = String.raw\`${src}\`;
79
+ var css = String.raw\`${escape(src)}\`;
80
var head = document.head || document.getElementsByTagName("head")[0];
81
var style = document.createElement("style");
82
style.type = "text/css";
0 commit comments