Altered selectors, ids and class names to fit plugin I currently use in Obsidian
This commit is contained in:
@@ -524,11 +524,11 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
plugins.push(() => {
|
plugins.push(() => {
|
||||||
return (tree: Root, file) => {
|
return (tree: Root, file) => {
|
||||||
visit(tree, "code", (node: Code) => {
|
visit(tree, "code", (node: Code) => {
|
||||||
if (node.lang === "mermaid") {
|
if (node.lang === "mehrmaid") {
|
||||||
file.data.hasMermaidDiagram = true
|
file.data.hasMermaidDiagram = true
|
||||||
node.data = {
|
node.data = {
|
||||||
hProperties: {
|
hProperties: {
|
||||||
className: ["mermaid"],
|
className: ["mehrmaid"],
|
||||||
"data-clipboard": JSON.stringify(node.value),
|
"data-clipboard": JSON.stringify(node.value),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -680,7 +680,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
visit(tree, "element", (node: Element, _idx, parent) => {
|
visit(tree, "element", (node: Element, _idx, parent) => {
|
||||||
if (
|
if (
|
||||||
node.tagName === "code" &&
|
node.tagName === "code" &&
|
||||||
((node.properties?.className ?? []) as string[])?.includes("mermaid")
|
((node.properties?.className ?? []) as string[])?.includes("mehrmaid")
|
||||||
) {
|
) {
|
||||||
parent!.children = [
|
parent!.children = [
|
||||||
{
|
{
|
||||||
@@ -719,17 +719,17 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
{
|
{
|
||||||
type: "element",
|
type: "element",
|
||||||
tagName: "div",
|
tagName: "div",
|
||||||
properties: { id: "mermaid-container", role: "dialog" },
|
properties: { id: "mehrmaid-container", role: "dialog" },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: "element",
|
type: "element",
|
||||||
tagName: "div",
|
tagName: "div",
|
||||||
properties: { id: "mermaid-space" },
|
properties: { id: "mehrmaid-space" },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: "element",
|
type: "element",
|
||||||
tagName: "div",
|
tagName: "div",
|
||||||
properties: { className: ["mermaid-content"] },
|
properties: { className: ["mehrmaid-content"] },
|
||||||
children: [],
|
children: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user