From 5b7d901d1e0fa3a696724b8f06a85440ace8c39a Mon Sep 17 00:00:00 2001 From: Ole Eskild Steensen Date: Wed, 19 Nov 2025 22:55:59 +0100 Subject: [PATCH] Allow whitespace before dataview keyword --- src/compiler/DataviewCompiler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/DataviewCompiler.ts b/src/compiler/DataviewCompiler.ts index 80192552..f76aa2c5 100644 --- a/src/compiler/DataviewCompiler.ts +++ b/src/compiler/DataviewCompiler.ts @@ -10,7 +10,7 @@ export class DataviewCompiler { compile: TCompilerStep = (file) => async (text) => { let replacedText = text; - const dataViewRegex = /```dataview\s(.+?)```/gms; + const dataViewRegex = /```\s*dataview\s(.+?)```/gms; const dvApi = getAPI(); if (!dvApi) return replacedText; @@ -19,7 +19,7 @@ export class DataviewCompiler { const dataviewJsPrefix = dvApi.settings.dataviewJsKeyword; const dataViewJsRegex = new RegExp( - "```" + escapeRegExp(dataviewJsPrefix) + "\\s(.+?)```", + "```\\s*" + escapeRegExp(dataviewJsPrefix) + "\\s(.+?)```", "gsm", ); const dataviewJsMatches = text.matchAll(dataViewJsRegex);