From 192479020dbce37c334a70957fa4b5ec2a221006 Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 14 Mar 2024 06:24:58 -0600 Subject: [PATCH] ttcMD: fixed rx for grid. Oopsie --- lib/tcmd/TokenIdentifiers.ts | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/tcmd/TokenIdentifiers.ts b/lib/tcmd/TokenIdentifiers.ts index d874eb4..6758cbb 100644 --- a/lib/tcmd/TokenIdentifiers.ts +++ b/lib/tcmd/TokenIdentifiers.ts @@ -37,7 +37,7 @@ TokenIdentifiers.set("grid", { const closeRx = /\/\[\]/g; return search(s, start, end, rx, closeRx); }, - rx: /(?:\[\])+\n+((?:.|\n)*?)\n+\/\[\]/g, + rx: /(?/g, + parse(s) { + return { + content: "", + metadata: { comment: s }, + raw: "", + type: "comment", + uuid: crypto.randomUUID(), + rendersContentOnly, + }; + }, +}); function findMatchingClosedParenthesis( str: string, @@ -358,11 +368,12 @@ function search( const newEnd = findMatchingClosedParenthesis( s, + // s.substring(0, end - start), openRx, closeRx, ); - if (newEnd === null) throw Error("BAD BAD BAD BAD"); + if (newEnd === null) throw Error("There was an issue finding a closing tag"); end = newEnd + start;