Excalidraw data should not be treated as link

This commit is contained in:
Ole Eskild Steensen 2022-03-14 16:32:30 +01:00 committed by GitHub
parent 2e9432181e
commit 795b6250db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,6 +82,10 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addTransform('link', function(str) { eleventyConfig.addTransform('link', function(str) {
return str && str.replace(/\[\[(.*?)\]\]/g, function(match, p1) { return str && str.replace(/\[\[(.*?)\]\]/g, function(match, p1) {
//Check if it is an embedded excalidraw drawing
if(p1.indexOf("],[") > -1){
return match;
}
const [fileName, linkTitle] = p1.split("|"); const [fileName, linkTitle] = p1.split("|");
let permalink = `/notes/${slugify(fileName)}`; let permalink = `/notes/${slugify(fileName)}`;
@ -120,4 +124,4 @@ module.exports = function(eleventyConfig) {
passthroughFileCopy: true, passthroughFileCopy: true,
}; };
}; };