ttcMD: adds additional formatting to card to make an unstyled block
ttcMD components: tweaked the look of accordions to stack together properly
This commit is contained in:
@@ -56,20 +56,22 @@ TokenIdentifiers.set("grid", {
|
||||
});
|
||||
|
||||
TokenIdentifiers.set("card", {
|
||||
rx: /\[{2}\n+([\s\S]*?)\n+\]{2}/g,
|
||||
rx: /\[{2}([\s\S]*?)\n+\]{2}/g,
|
||||
search(s, start, end) {
|
||||
const rx = /\[\[/g;
|
||||
const crx = /\]\]/g;
|
||||
return search(s, start, end, rx, crx);
|
||||
},
|
||||
parse(s) {
|
||||
const rx = /\[{2}\n+([\s\S]*)\n+\]{2}/;
|
||||
const [_, content] = s.match(rx) || ["", "Unable to parse card"];
|
||||
const rx = /\[{2}(!?)\n+([\s\S]*)\n+\]{2}/;
|
||||
const [_, isBlock, content] = s.match(rx) || ["", "Unable to parse card"];
|
||||
|
||||
return {
|
||||
content: content.trim(),
|
||||
raw: s,
|
||||
metadata: {},
|
||||
metadata: {
|
||||
isBlock,
|
||||
},
|
||||
type: "card",
|
||||
uuid: crypto.randomUUID(),
|
||||
};
|
||||
|
Reference in New Issue
Block a user