Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"interpolation-punctuation": {
pattern: /^\$\{|\}$/,
alias: "punctuation"
},
rest: refract.languages.jsx
}
},
string: {
pattern: /[^$;]+/,
inside: refract.languages.css,
alias: "language-css"
}
}
}
};
refract.languages.insertBefore("jsx", "template-string", styledHighlight);
refract.languages.insertBefore("js", "template-string", styledHighlight);
const withMDX = require("@next/mdx")({
extension: /\.mdx?$/,
options: {
// $FlowIssue
hastPlugins: [require("@mapbox/rehype-prism")]
}
});
const fs = require("fs");
const { join } = require("path");
const generateJsonFeed = require("./data/generate-json-feed");
const { promisify } = require("util");
const copyFile = promisify(fs.copyFile);
const staticFilesToCopy = ["favicon.ico"];
// NOTE: This highlights template-strings as strings of CSS
const styledHighlight = {
"styled-template-string": {
pattern: /(styled(\.\w+|\([^\)]*\))(\.\w+(\([^\)]*\))*)*|css|injectGlobal|createGlobalStyle|keyframes|\.extend|\.withComponent)`(?:\$\{[^}]+\}|\\\\|\\?[^\\])*?`/,
lookbehind: true,
greedy: true,
inside: {
interpolation: {
pattern: /\$\{[^}]+\}/,
inside: {
"interpolation-punctuation": {
pattern: /^\$\{|\}$/,
alias: "punctuation"
},
rest: refract.languages.jsx
}
},
string: {
pattern: /[^$;]+/,
inside: refract.languages.css,
alias: "language-css"
}
}
}
};
refract.languages.insertBefore("jsx", "template-string", styledHighlight);
refract.languages.insertBefore("js", "template-string", styledHighlight);
const withMDX = require("@next/mdx")({
extension: /\.mdx?$/,
options: {