More specific checks for mathjax and excalidraw

This commit is contained in:
Ole Eskild Steensen 2022-03-15 15:26:58 +01:00 committed by GitHub
parent 6d39919a3f
commit 1bac437d6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,7 +83,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addTransform('link', function(str) {
return str && str.replace(/\[\[(.*?)\]\]/g, function(match, p1) {
//Check if it is an embedded excalidraw drawing or mathjax javascript
if (p1.indexOf(",") > -1) {
if (p1.indexOf("],[") > -1 || p1.indexOf('"$"')) {
return match;
}
const [fileName, linkTitle] = p1.split("|");
@ -124,4 +124,4 @@ module.exports = function(eleventyConfig) {
passthroughFileCopy: true,
};
};
};